This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: datetime.utctimetuple() method should respect fold disambiguation
Type: enhancement Stage:
Components: Versions: Python 3.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: belopolsky Nosy List: belopolsky
Priority: normal Keywords:

Created on 2016-08-08 16:18 by belopolsky, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg272175 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-08-08 16:18
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)
msg272176 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-08-08 16:21
This would be a feature not anticipated by PEP 495.
History
Date User Action Args
2022-04-11 14:58:34adminsetgithub: 71898
2016-08-08 16:21:37belopolskysetstatus: open -> closed
type: behavior -> enhancement
resolution: rejected
messages: + msg272176
2016-08-08 16:18:06belopolskycreate