Hacker News new | ask | show | jobs
by gerikson 1391 days ago
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.
1 comments

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.
About as difficult as it is to add 1 before printing the month as a number.