How to extract the abbreviated weekday name from specific date and culture (language) in C#

1 Answer

0 votes
using System;
using System.Globalization;

class Program
{
    static void Main() {
        DateTime adate = new DateTime(2020, 8, 24);
        
        Console.WriteLine(adate.ToString("ddd", new CultureInfo("fr-FR")));
        Console.WriteLine(adate.ToString("ddd", new CultureInfo("de-DE")));
        Console.WriteLine(adate.ToString("ddd", new CultureInfo("pl-PL")));
    }
}



/*
run:

lun.
Mo
pon.

*/

 



answered Oct 8, 2020 by avibootz

Related questions

...