Given a pytz timezone for a particular user(calculated from his offset), i want to display the common name for that timezone. I\'m assuming people are more accustomed to see
If you are looking for the abbreviations then there are a few ways that come to mind.
First would be:
>>> from pytz import timezone
>>> eastern = timezone('US/Eastern')
>>> eastern._tzname
'EST'
Although since that references a property with the preceding single underscore it may be considered private and might not be the best place to grab it. The other would be from a localized datetime object.
>>> from datetime import datetime
>>> loc_dt = eastern.localize(datetime.now())
>>> loc_dt.strftime('%Z')
'EST'