C# Cultures: Localize DayOfWeek?

How about

DateTimeFormatInfo.CurrentInfo.GetDayName( dayOfWeek )

or

DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName( dayOfWeek )

Simply takes a DayOfWeek enumeration and returns string that is the name in the current culture.

Edit:

If you’re looking for a specific culture it would be

var cultureInfo = new CultureInfo( "it-IT" );
var dateTimeInfo = cultureInfo.DateTimeFormat;

then you can call GetDayName or GetAbbreviatedDayName as you choose.

There’s even a AbbreviatedDayNames/DayNames arrays if you want them all

Leave a Comment

tech