I need to create a billing scheme where to pay week goes Friday to Thursday.
CultureInfo cult = new CultureInfo("en-US",true);
Calendar FIMCal;
cult.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Friday;
cult.DateTimeFormat.CalendarWeekRule = CalendarWeekRule.FirstFullWeek;
FIMCal = cult.Calendar;
int result = (int)FIMCal.GetDayOfWeek(DateTime.Now);
The variable "result" is assigned 1 for Monday when it should be 3. Friday should be 0 Thurday 6 and so on.
Why is the Cultureinfo not changing the DayofWeek enum???
CultureInfo.DateTimeFormat.FirstDayOfWeek not changing results for CultureInfo.Calendar.GetDayOfWeek(DateTime);
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Guest UserRank #1,422 · 1.2K reputationPosted Dec 29, 2010, 10:22 AM EST
Console.WriteLine( FIMCal.GetDayOfWeek( DateTime.Parse( "2010-12-27" ) ) );
You get "Monday" in response, because it is a Monday.