Re:History of Zero-Based Months?
by gerikson on Saturday August 27, 2022 @04:58AM
(#32617137)
At least in Perl, the rationale for this (apart from copying C) is that it's very easy to reference a list (array) of month names if the month indices are zero-based.
[ Parent
| on HN ]
Re:History of Zero-Based Months?
by DonaldFisk on Saturday August 27, 2022 @05:40AM
(#32617355)
How difficult is it to either subtract 1 before indexing your array, or have a 13 element array with a dummy value in element 0? Deprecate time.h and adopt ISO 8601 already.
Or put Dec a second time, at 0, and then % 12 works.