Skip to content

Implement tzinfo.dst() method in timezone #53259

Closed

Description

@abalkin
BPO 9013
Nosy @brettcannon, @mdickinson, @abalkin
Dependencies
  • bpo-5094: datetime lacks concrete tzinfo implementation for UTC
  • 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-14.18:22:35.437>
    created_at = <Date 2010-06-16.17:58:30.019>
    labels = ['extension-modules', 'type-feature']
    title = 'Implement tzinfo.dst() method in timezone'
    updated_at = <Date 2010-10-14.18:22:35.436>
    user = 'https://github.com/abalkin'

    bugs.python.org fields:

    activity = <Date 2010-10-14.18:22:35.436>
    actor = 'belopolsky'
    assignee = 'belopolsky'
    closed = True
    closed_date = <Date 2010-10-14.18:22:35.437>
    closer = 'belopolsky'
    components = ['Extension Modules']
    creation = <Date 2010-06-16.17:58:30.019>
    creator = 'belopolsky'
    dependencies = ['5094']
    files = []
    hgrepos = []
    issue_num = 9013
    keywords = []
    message_count = 2.0
    messages = ['107940', '118707']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'mark.dickinson', 'belopolsky']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue9013'
    versions = ['Python 3.2']

    Activity

    1. abalkin commented on Jun 16, 2010

      @abalkin
      MemberAuthor

      This idea was brought in the original fixed offset timezone proposal (see bpo-5094), but was met with some opposition. See msg106914, point 2. As a result, the timezone implementation is in conflict with tzinfo documentation that says "If utcoffset() does not return None, dst() should not return None either." http://docs.python.org/dev/py3k/library/datetime.html#datetime.tzinfo.utcoffset

      Note that dst() is not needed for time calculations involving fixed offset timezones because DST shift is included in utcoffset(). It is however needed for interoperability with timetuple time representation. See bpo-9004.

      If the long term goal is to move users from using timetuples to to datetime objects, it is important for time objects to be able to store DST flag.

    2. self-assigned this
      on Jun 16, 2010
    3. abalkin commented on Oct 14, 2010

      @abalkin
      MemberAuthor

      After thinking some more about this issue, I am going to withdraw this proposal. If we want to support storing dst flag in datetime instances, it should be stored in the datetime object itself, not in tzinfo.

      See

      http://mail.python.org/pipermail/python-dev/2010-August/102842.html

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions