python 时区转换
生活随笔
收集整理的這篇文章主要介紹了
python 时区转换
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
from datetime import datetime
from datetime import timezone
from datetime import timedelta# 世界標準時間
utc_time = datetime(2019, 7, 30, 7, 50, 0)# 北京時間UTC+8
cst_time =utc_time.astimezone(timezone(timedelta(hours=-8))).strftime("%Y-%m-%d %H:%M:%S")
轉(zhuǎn)載于:https://www.cnblogs.com/cooolr/p/11270674.html
總結(jié)
以上是生活随笔為你收集整理的python 时区转换的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SDNU 1406.A+B问题(水题)
- 下一篇: 【python】闭包