Often you need to display the complete day of the week in your C# code.
This simple program shows all seven different day strings you can get from the dddd format.
- using System;
-
- namespace forgetCode
- {
- class Program
- {
- static void Main(string[] args)
- {
- DateTime now = DateTime.Today;
- for (int i = 0; i < 7; i++)
- {
- Console.WriteLine(now.ToString("dddd"));
- now = now.AddDays(1);
- }
- }
-
- }
- }
Output:
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
..