[tz] tzfiles contain Unix epoch for the first transition time

Paul Eggert eggert at cs.ucla.edu
Sat Aug 15 23:58:38 UTC 2015

random832 at fastmail.us wrote:
> strftime apparently has no
> trouble formatting a year of 2147485547 (2**31+1899) despite that being
> beyond the 32-bit limit.

tzcode strftime has special code to format years correctly even if tm_year + 
1900 exceeds INT_MAX.  See the _yconv code involving DIVISOR in strftime.c.  As 
I understand it POSIX requires this sort of thing.  That is, although POSIX 
doesn't require support for UTC years before 1970, POSIX does require that 
localtime and strftime support UTC years through INT_MAX + 1900 if time_t is 
wide enough (e.g., the common case of 64-bit time_t and 32-bit int).

More information about the tz mailing list