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: add strptime(s, '%s')
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: belopolsky Nosy List: akira, belopolsky, p-ganssle
Priority: normal Keywords: patch

Created on 2014-08-21 23:48 by akira, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
draft-strptime-%s.diff akira, 2014-08-22 00:02 review
Messages (3)
msg225624 - (view) Author: Akira Li (akira) * Date: 2014-08-21 23:48
issue12750 makes strftime('%s') portable. For symmetry,
datetime.strptime(s, '%s') could be enabled to return local time as an
aware (to avoid loosing info) datetime object for a given integer
(seconds since the Epoch) timestamp string.

I've uploaded a prototype patch with a draft implementation, docs, and
tests.
msg238840 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-03-21 22:44
It's a comprehensive patch so can we have a formal review please.
msg270534 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-07-16 02:24
With PEP 495, conversion from timestamp to naive datetime will no longer loose information.  In light of this, I would like to reconsider what strftime('%s') should return in the absence of %z.
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66442
2020-03-18 18:00:00brett.cannonsetnosy: - brett.cannon
2019-04-21 06:42:33xtreaksetnosy: + p-ganssle
2016-07-16 21:25:36rhettingersetnosy: + brett.cannon
2016-07-16 19:11:26BreamoreBoysetnosy: - BreamoreBoy
2016-07-16 02:24:04belopolskysetmessages: + msg270534
2016-07-16 02:19:02belopolskysetassignee: belopolsky
versions: + Python 3.6, - Python 3.5
2015-03-21 22:44:32BreamoreBoysetnosy: + BreamoreBoy
messages: + msg238840
2014-08-22 17:30:23berker.peksagsetnosy: + belopolsky

stage: patch review
2014-08-22 00:02:06akirasetfiles: + draft-strptime-%s.diff
2014-08-22 00:01:59akirasetfiles: - draft-strptime-%s.diff
2014-08-21 23:48:56akiracreate