Skip to content

add strptime(s, '%s') #66442

Description

@4kir4
mannequin
BPO 22246
Nosy @abalkin, @4kir4, @pganssle
Files
  • draft-strptime-%s.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/abalkin'
    closed_at = None
    created_at = <Date 2014-08-21.23:48:56.540>
    labels = ['type-feature', 'library']
    title = "add strptime(s, '%s')"
    updated_at = <Date 2020-03-18.18:00:00.204>
    user = 'https://github.com/4kir4'

    bugs.python.org fields:

    activity = <Date 2020-03-18.18:00:00.204>
    actor = 'brett.cannon'
    assignee = 'belopolsky'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2014-08-21.23:48:56.540>
    creator = 'akira'
    dependencies = []
    files = ['36431']
    hgrepos = []
    issue_num = 22246
    keywords = ['patch']
    message_count = 3.0
    messages = ['225624', '238840', '270534']
    nosy_count = 3.0
    nosy_names = ['belopolsky', 'akira', 'p-ganssle']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22246'
    versions = ['Python 3.6']

    Activity

    1. 4kir4 commented on Aug 21, 2014

      4kir4mannequin
      MannequinAuthor

      bpo-12750 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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Aug 21, 2014
    3. BreamoreBoy commented on Mar 21, 2015

      BreamoreBoymannequin
      Mannequin

      It's a comprehensive patch so can we have a formal review please.

    4. self-assigned this
      on Jul 16, 2016
    5. abalkin commented on Jul 16, 2016

      @abalkin
      Member

      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.

    6. transferred this issue fromon Apr 10, 2022
    7. StanFromIreland commented on Mar 20, 2025

      @StanFromIreland
      Member

      This is a duplicate: #56959

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions