System.Globalization.Calendar.GetWeekOfYear() returns odd results

Have a look at the values of CalendarWeekRule. You are using FirstFourDayWeek, and so you are getting the values you describe. If you want every week to have exactly 7 days, you should use FirstFullWeek.

In your case, that would mean that 31. 12. 2007 will be week 53, but so will 2. 1. 2008.


The documentation for the CalendarWeekRule enumeration specifically states that it "does not map directly to ISO 8601", and links to ISO 8601 Week of Year format in Microsoft .Net, a blog entry that describes the differences.