In some systems it may be useful to display the day of the week in a three-letter form.
Here we see a simple program that prints out the days of the week in three-letter format.
usingSystem;
namespaceforgetCode
{
classProgram
{
staticvoidMain(string[] args)
{
DateTime now = DateTime.Today;
for (int i = 0; i < 7; i++)
{
Console.WriteLine(now.ToString("ddd"));
now = now.AddDays(1);
}
}
}
}
Output:
Sun
Mon
Tue
Wed
Thu
Fri
Sat
..
Tags for Printing days in a week in three letter format in C#