This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] [BZ #16141] strptime: extend %z range to UTC+14:00
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: James Perkins <james at loowit dot net>, libc-alpha at sourceware dot org
- Date: Tue, 02 Dec 2014 17:31:27 -0800
- Subject: Re: [PATCH 1/2] [BZ #16141] strptime: extend %z range to UTC+14:00
- Authentication-results: sourceware.org; auth=none
- References: <1417564016-3572-1-git-send-email-james at loowit dot net>
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.