I've got this code:
Calendar cal = CultureInfo.InvariantCulture.Calendar;
String dow = cal.GetDayOfWeek(DateTime.Now).ToString();
if (dow.Equals("Monday"))
...but I wonder if it would still work in German-speaking locales ("Montag") or Spanish-speaking locales ("Lunes"). If not - if looking for "Monday" is problematic - how can I get an int that reprsents day of the week. And even in that case, is 0 always Sunday, or is it sometimes Monday (or even something else)?
It's already an
enum
value, so don't cast it to astring
before doing the comparison: