Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support %z format in time.strftime and _strptime? #48336

Closed
smontanaro opened this issue Oct 9, 2008 · 2 comments
Closed

support %z format in time.strftime and _strptime? #48336

smontanaro opened this issue Oct 9, 2008 · 2 comments
Assignees
Labels
type-feature A feature request or enhancement

Comments

@smontanaro
Copy link
Contributor

BPO 4086
Nosy @abalkin
Superseder
  • bpo-6641: datetime.strptime doesn't support %z format ?
  • 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 = <Date 2010-10-15.17:54:36.396>
    created_at = <Date 2008-10-09.11:27:25.421>
    labels = ['type-feature']
    title = 'support %z format in time.strftime and _strptime?'
    updated_at = <Date 2010-10-15.17:54:36.395>
    user = 'https://github.com/smontanaro'

    bugs.python.org fields:

    activity = <Date 2010-10-15.17:54:36.395>
    actor = 'georg.brandl'
    assignee = 'belopolsky'
    closed = True
    closed_date = <Date 2010-10-15.17:54:36.396>
    closer = 'georg.brandl'
    components = []
    creation = <Date 2008-10-09.11:27:25.421>
    creator = 'skip.montanaro'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 4086
    keywords = []
    message_count = 2.0
    messages = ['74570', '118701']
    nosy_count = 1.0
    nosy_names = ['belopolsky']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '6641'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue4086'
    versions = ['Python 3.2']

    @smontanaro
    Copy link
    Contributor Author

    While responding to a c.l.py question just now I discovered that
    numeric timezone offsets don't appear to be supported by either the
    time.strftime function or the _strptime module. I noticed on my
    Mac's strftime(3) man page that it supports a %Z format for TZ
    names and a %z format for numeric tz offsets. It seems Python
    should as well.

    @smontanaro smontanaro added the type-feature A feature request or enhancement label Oct 9, 2008
    @abalkin abalkin self-assigned this Jun 12, 2010
    @abalkin
    Copy link
    Member

    abalkin commented Oct 14, 2010

    Closing as a duplicate of (closed) bpo-6641.

    time.strftime appears to support %z on the platforms that support it in C strftime:

    >>> time.strftime("%z", time.localtime())
    '-0400'

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants