[issue31644] bug in datetime.datetime.timestamp

2017-09-29 Thread Kadir Liano

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.

datetime.datetime.strptime(dtstr,fmt).timestamp()

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31644] bug in datetime.datetime.timestamp

2017-09-29 Thread Eric V. Smith

Eric V. Smith  added the comment:

This is a daylight savings time folding problem. Without a timezone, those are 
in fact the same point in time, at least in my timezone (US Eastern).

If you specify a timezone, you'll see the difference:

datetime.datetime(2014,3,9,2,tzinfo=datetime.timezone(datetime.timedelta(0))).timestamp()
 -> 1394330400.0

datetime.datetime(2014,3,9,3,tzinfo=datetime.timezone(datetime.timedelta(0))).timestamp()
 -> 1394334000.0

These are 3600 seconds, or one hour, apart.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31644] bug in datetime.datetime.timestamp

2017-09-29 Thread Kadir Liano

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 datetime.datetime.timestamp
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com