Python Timezone conversion

2019-01-02 21:02发布

I am looking for a quick way to type in a time and then python convert it into other timezones ( maybe up to 10 different timezones )

Sorry. I am not familar with time in python at all, if someone could put me in the right direction I would really appreciate it.

7条回答
流年柔荑漫光年
2楼-- · 2019-01-02 21:39

For Python 3.2+ simple-date is a wrapper around pytz that tries to simplify things.

If you have a time then

SimpleDate(time).convert(tz="...")

may do what you want. But timezones are quite complex things, so it can get significantly more complicated - see the the docs.

查看更多
登录 后发表回答