How to get pytz timezone from common abbreviation (PST, EST, etc.)?

后端 未结 2 1229
清歌不尽
清歌不尽 2021-02-20 13:39

This is a similar question as How to get the common name for a pytz timezone eg. EST/EDT for America/New_York , except I want to be able to just get a timezone from \"PST\" from

2条回答
  •  鱼传尺愫
    2021-02-20 14:13

    I ended up just manually making a dictionary that mapped abbreviations to timezone names. For example, 'PST' : 'America/Los_Angeles' would be an entry (as would PDT for the daylight savings abbreviation).

提交回复
热议问题