简化时间处理的Python库:Delorean
jopen
10年前
Delorean是一个Python库,提供了简单方便的日期时间转换。处理日期时间的生成列表,时区转换,等等。
Here is the world without a flux capacitor at your side:
from datetime import datetime from pytz import timezone EST = "US/Eastern" UTC = "UTC" d = datetime.utcnow() utc = timezone(UTC) est = timezone(EST) d = utc.localize(d) d = est.normalize(EST) return d