DateTime current = DateTime.Now; Console.WriteLine("Current time is: " + current);
string dateString = "2022/12/31"; DateTime convertedDate = DateTime.Parse(dateString); Console.WriteLine("Converted date is: " + convertedDate);
DateTime now = DateTime.Now; DateTime future = now.AddDays(7); Console.WriteLine("Future date is: " + future);This code will add 7 days to the current date and time and return the new date and time. The package library for the DateTime class is the .NET framework.