def for_system(klass):
"""Return a FixedOffset instance for the current working timezone and
DST conditions.
"""
if time.localtime().tm_isdst and time.daylight:
offset = time.altzone
else:
offset = time.timezone
return klass(-offset // 60)
评论列表
文章目录