2 ms·
Oh yes. The ISO definition is pretty straightforward: «The first week of a year is the week that contains the first Thursday of the year.» (http://en.wikipedia.
by VMG 14y ago
Oh yes. The ISO definition is pretty straightforward: «The first week of a year is the week that contains the first Thursday of the year.» (http://en.wikipedia.org/wiki/ISO_week_date http://en.wikipedia.org/wiki/ISO_week_date)
Actual implementations often look more like this: http://www.epoch-calendar.com/support/getting_iso_week.html http://www.epoch-calendar.com/support/getting_iso_week.html
Implementing it as a one-liner would be an interesting code golf exercise.