How to display the complete three-letter days of the week in C#

1 Answer

0 votes
using System;
using System.Globalization;
using System.Threading;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime now = DateTime.Now;

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            for (int i = 0; i < 7; i++) {
                Console.WriteLine(now.ToString("ddd"));
                now = now.AddDays(1);
            }
        }
    }
}


/*
run:
  
Tue
Wed
Thu
Fri
Sat
Sun
Mon
 
*/

 



answered Aug 14, 2018 by avibootz

Related questions

1 answer 241 views
3 answers 342 views
342 views asked Mar 25, 2015 by avibootz
1 answer 187 views
187 views asked Sep 12, 2020 by avibootz
1 answer 282 views
1 answer 128 views
1 answer 137 views
...