3 ms·
The OpenBSD manual under strftime (referenced in the date man page) shows "%G is replaced by the ISO 8601 year with century as a decimal number." Which leads t
by protomyth 12y ago
The OpenBSD manual under strftime (referenced in the date man page) shows "%G is replaced by the ISO 8601 year with century as a decimal number." Which leads to http://en.wikipedia.org/wiki/ISO_8601 http://en.wikipedia.org/wiki/ISO_8601 and http://en.wikipedia.org/wiki/ISO_week_date http://en.wikipedia.org/wiki/ISO_week_date which says "The ISO 8601 definition for week 01 is the week with the year's first Thursday in it."
Our example is a couple of activity reports we send to the government where we need to have full weeks and they want calendar years and not budget years[1]. I seem to remember payroll for some uses the same scheme (yep, we pay weekly). Plus some internal reporting the the ISO date makes nice since we have a 2 week break which includes Xmas and New Years.
1) These are a bit of odd ducks actually. Most government reporting we do is based on Federal Fiscal years which start Oct 1. I remember in the 90's one foxbase function that did a similar algorithm except centered on Oct 1 and defined the first day of the week as Sunday.