days of week

  • Thread starter Thread starter MAF
  • Start date Start date
Indeed there is. Create a System.Globalization.CultureInfo object. Then
retrieve the DateTimeFormat.DayNames property. This returns a string array
containing the appropriate days of the week for the appropriate culture.
Example:

System.Globalization.CultureInfo ci = new CultureInfo("de-DE");
string[] _Days = ci.DateTimeFormat.DayNames;

Alternatively, to retrieve the days of the week appropriate for the culture
of the active thread you can use the static property CurrentInfo:

string[] _Days =
System.Globalization.DateTimeFormatInfo.CurrentInfo.DayNames;

Note that this only works for specific cultures or the invariant culture.
--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Are they always in a given order, for example 1= Sunday, 2 = Monday...7=
Saturday?
 
Back
Top