DayOfWeek currentDayOfWeek = DateTime.Now.DayOfWeek; Console.WriteLine("Today is " + currentDayOfWeek);
DateTime now = DateTime.Now; int daysUntilMonday = ((int) DayOfWeek.Monday - (int) now.DayOfWeek + 7) % 7; Console.WriteLine("There are " + daysUntilMonday + " days until Monday.");This code first retrieves the current day of the week, then calculates the number of days until the next Monday by subtracting the current day from Monday (taking into account that Sunday is the zeroth day). The result is displayed on the console. The DayOfWeek enum is part of the System namespace in the .NET framework, so no additional package or library is required to use it.