[PATCH 1/2] [BZ #16141] strptime: extend %z range to UTC+14:00
Paul Eggert
eggert@cs.ucla.edu
Wed Dec 3 01:31:00 GMT 2014
James Perkins wrote:
> Extending the valid positive timezone offset to +14:00 allows
> for the correct parsing of several timezone offsets
Why stop with the range -12..+14? A wider range is needed to support past
historical timestamps, e.g., when the Philippines used American time and NW
North America used Asian:
$ TZ=Asia/Manila date -d@-4039286400 --rfc-3339=seconds
1841-12-31 08:04:00-15:56
$ TZ=America/Juneau date -d@-4039286400 --rfc-3339=seconds
1842-01-01 15:02:19+15:02
Also, POSIX allows the range -24 .. +25 for the hours field:
$ TZ=XXX-24:59YYY,2,1 date -d@0 --rfc-3339=seconds
1970-01-02 01:59:00+25:59
$ TZ=ZZZ24:59 date -d@0 --rfc-3339=seconds
1969-12-30 23:01:00-24:59
So I suggest allowing at least -24 .. +25.
More information about the Libc-alpha
mailing list