(no title)
jks | 1 year ago
Yet another fun fact: with %V week numbers, the date 2024-12-30 (December 30, 2024) was 2025-W01-1 (the Monday of week 1, 2025). Thus strftime needs two different ways to specify the year: %G denotes the year that goes with %V week numbers, %Y denotes the year that people usually think of when they ask "what year is it". Unfortunately %G comes before %Y on the strftime man page, so people who scan the page quickly can easily pick %G when they really want %Y. I've seen a few bugs caused by this.
I have also seen the corresponding bug in SQL, using IYYY instead of YYYY. This boggles the mind, but apparently when some people read "ISO 8601 week-numbering year", they only see "ISO 8601 ... year", think "yes, that's the date standard we use" and don't care about the "week-numbering" word in the middle.
No comments yet.