Issue 22246: add strptime(s, '%s') (original) (raw)

Issue22246

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
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:07 admin set github: 66442
2020-03-18 18:00:00 brett.cannon set nosy: - brett.cannon
2019-04-21 06:42:33 xtreak set nosy: + p-ganssle
2016-07-16 21:25:36 rhettinger set nosy: + brett.cannon
2016-07-16 19:11:26 BreamoreBoy set nosy: - BreamoreBoy
2016-07-16 02:24:04 belopolsky set messages: +
2016-07-16 02:19:02 belopolsky set assignee: belopolskyversions: + Python 3.6, - Python 3.5
2015-03-21 22:44:32 BreamoreBoy set nosy: + BreamoreBoymessages: +
2014-08-22 17:30:23 berker.peksag set nosy: + belopolskystage: patch review
2014-08-22 00:02:06 akira set files: + draft-strptime-%s.diff
2014-08-22 00:01:59 akira set files: - draft-strptime-%s.diff
2014-08-21 23:48:56 akira create