* parse-datetime: invalid date range shifted by 30 minutes for Singapore TZ
@ 2019-08-12 15:02 Kamil Dudka
0 siblings, 0 replies; only message in thread
From: Kamil Dudka @ 2019-08-12 15:02 UTC (permalink / raw)
To: bug-gnulib
In 1981, there was a change in TZ for Singapore and Malaysia which went from
UTC+7.5 to UTC+8. It happened at 1981-12-31 23:30:00 which became 1982-01-01
00:00:00.
As I understand it, the range 1981-12-31 23:30:00 .. 1981-12-31 23:59:59
should be invalid, whereas the range 1982-01-01 00:00:00 .. 1982-01-01
00:29:59 should be valid. GNU date sees it exactly opposite.
I do not fully understand the code of gnulib's parse-datetime.y -- mktime_z()
converts 1982-01-01 00:00:00 to 1981-12-31 23:30:00 and the subsequent call
of mktime_ok() returns false, causing the failure.
Minimal example:
$ TZ=Asia/Singapore date --debug -d 1982-01-01
date: parsed date part: (Y-M-D) 1982-01-01
date: input timezone: TZ="Asia/Singapore" environment value
date: warning: using midnight as starting time: 00:00:00
date: error: invalid date/time value:
date: user provided time: '(Y-M-D) 1982-01-01 00:00:00'
date: normalized time: '(Y-M-D) 1981-12-31 23:30:00'
date: ---- -- -- -- --
date: possible reasons:
date: invalid day/month combination;
date: numeric values overflow;
date: missing timezone
date: invalid date ‘1982-01-01’
Original reported at https://bugzilla.redhat.com/1739747 .
Kamil
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-12 15:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 15:02 parse-datetime: invalid date range shifted by 30 minutes for Singapore TZ Kamil Dudka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).