Earlier quoted context omitted.
https://linux.die.net/man/3/localtime : tm_mday: The day of the month, in the range 1 to 31. tm_mon: The number of months since January, in the range 0 to 11. I wonder where C got it? It goes back to at least 1973's V4: https://github.com/dspinellis/unix-history-repo/commit/92779...
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/... Convenience. Look at how the days in the months are stored and accessed. Using 1-based months would introduce an extra calculation (-1) on all searches or an unused value in the 0-index. Also look at how printing is handled for weekday and month names. They, again, take advantage of 0-based indexing. Day and year are already represented as numbers, so it…
Or, if you're willing to give up three bytes, index into "ErrSunMonTueWedThuFriSat".
Or, and this is mildly insane but perhaps in keeping with early C, have your pointer be three bytes before the beginning of "SunMonTueWedThuFriSat" and use one-based indexing.