This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug time/17646] mktime: unpredictable return value for ambiguous time, depends on previous mktime call
- From: "eggert at cs dot ucla.edu" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 03 May 2017 14:56:35 +0000
- Subject: [Bug time/17646] mktime: unpredictable return value for ambiguous time, depends on previous mktime call
- Auto-submitted: auto-generated
- References: <bug-17646-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17646
eggert at cs dot ucla.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |eggert at cs dot ucla.edu
--- Comment #1 from eggert at cs dot ucla.edu ---
mktime has unpredictable values even when tm_isdst is 0. For example, when
TZ='Europe/Moscow', asking mktime about 2014-10-26 01:30:00 with tm_isdst=0 can
yield either 1414272600 (2014-10-26 01:30:00 +0400) or 1414276200 (2014-10-26
01:30:00 +0300); both time stamps are valid because Moscow changed its standard
time zone that morning.
I suppose mktime could be altered to always return the earliest among ambiguous
dates, or something like that. However, with the current architecture this
would significantly slow down mktime. It'd take quite a bit of hacking to
adjust mktime to be more predictable, and the benefits of such a change do not
clearly outweigh the cost. AFter all, with ambiguous dates, no matter what
mktime does, it'll be "wrong" for some users.
--
You are receiving this mail because:
You are on the CC list for the bug.