New submission from Kadir Liano :
datetime.datetime(2014,3,9,2).timestamp() returns 1394352000.0
datetime.datetime(2014,3,9,3).timestamp() returns 1394352000.0
--
components: Library (Lib)
messages: 303362
nosy: kliano
priority: normal
severity: normal
status: open
title: bug in
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:
Kadir Liano added the comment:
The datetime object returned by strptime() does not have tzinfo. Whatever
default timezone that was chosen should produce consistent timestamp. Reading
a sequential datetime string and converting it to a sequence of timestamp
results in expected time folding
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