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

Add timezone_abbr property shortcut to tzname() #464

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

StephenBrown2
Copy link

@StephenBrown2 StephenBrown2 commented Apr 17, 2020

This adds a shortcut property to DateTime objects to get the timezone abbreviation, which can only be gotten from a datetime, since DST will change the result.

I had also wanted to get a list of acceptable abbreviations to add reverse parsing of "zz" in #463, but found it was more complicated than that and even getting the std abbreviation from a Timezone object directly wasn't possible.

I've added tests for everywhere dt.timezone_name is called, since it's a similar tied property, but if that's too many, I can back them out and just leave the one test in tests/datetime/test_getters.py

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants