[New-bugs-announce] [issue27711] datetime.utctimetuple() method should respect fold disambiguation

Alexander Belopolsky report at bugs.python.org
Mon Aug 8 12:18:06 EDT 2016


New submission from Alexander Belopolsky:

With TZ = America/New_York:

>>> t0 = datetime(2016, 11, 6, 1, 30, fold=0)
>>> t1 = datetime(2016, 11, 6, 1, 30, fold=1)
>>> t0.utctimetuple()[:6]
(2016, 11, 6, 1, 30, 0)
>>> t1.utctimetuple()[:6]
(2016, 11, 6, 1, 30, 0)
>>> t0.timestamp()
1478410200.0
>>> t1.timestamp()
1478413800.0

The correct values for utctimetuple() should be the same as

>>> datetime.utcfromtimestamp(t0.timestamp()).timetuple()[:6]
(2016, 11, 6, 5, 30, 0)
>>> datetime.utcfromtimestamp(t1.timestamp()).timetuple()[:6]
(2016, 11, 6, 6, 30, 0)

----------
assignee: belopolsky
messages: 272175
nosy: belopolsky
priority: normal
severity: normal
status: open
title: datetime.utctimetuple() method should respect fold disambiguation
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27711>
_______________________________________


More information about the New-bugs-announce mailing list