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

后端 未结 2 1228
清歌不尽
清歌不尽 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:25

    Have you tried using strptime with the %Z format code? I've never done it myself, but at least in theory you should be able to put in the tz code there and it should get translated into a tzinfo (embedded in the datetime/time object)

提交回复
热议问题