This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug time/17646] mktime: unpredictable return value for ambiguous time, depends on previous mktime call


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]