[issue31646] bug in time.mktime

2017-09-30 Thread Tim Peters
Tim Peters added the comment: Note that 2am doesn't exist on the local clock: it leaps from 1:59:59 to 3:00:00. You're claiming that one answer is "correct", but why? The relevant _standards_ don't appear to specify what happens when the input is senseless. Note that the behavior isn't re

[issue31646] bug in time.mktime

2017-09-30 Thread R. David Murray
Change by R. David Murray : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python

[issue31646] bug in time.mktime

2017-09-29 Thread Eryk Sun
Eryk Sun added the comment: This depends on the way the platform mktime implements folding when the clock is advanced for daylight saving time. It appears the timezone on your systems is set to US/Canada Central Time, for which on March 9th the clocks were advanced forward at 02:00:00 [1]. Wi

[issue31646] bug in time.mktime

2017-09-29 Thread Kadir Liano
Kadir Liano added the comment: time.mktime(time.strptime('09-Mar-14 01:00:00',fmt)) time.mktime(time.strptime('09-Mar-14 02:00:00',fmt)) Both statements produce 1394348400.0 in Win7. The answers are 1394348400.0 and 1394352000.0 in Linux which is the correct behavior. -- ___

[issue31646] bug in time.mktime

2017-09-29 Thread Eryk Sun
Eryk Sun added the comment: mktime() is the inverse of localtime(). With the given format string, strptime() sets tm_isdst to -1, for which mktime will use the system's timezone information to determine whether or not it's daylight saving time. You need to verify that the time zones are the s

[issue31646] bug in time.mktime

2017-09-29 Thread Kadir Liano
New submission from Kadir Liano : import time fmt = '%d-%b-%y %H:%M:%S' print(time.mktime(time.strptime('09-Mar-14 02:00:00',fmt))) 1394348400.0 in Windows 7, Python 2.7 and 3.6 1394352000.0 in LinuxMint LMDE 2, Python 3.6 -- components: Library (Lib) messages: 303378 nosy: kliano prior