Discuss / Python / 作业

作业

Topic source

阿萌QVQ

#1 Created at ... [Delete] [Delete and Lock User]
re_utc = re.compile(r'^UTC([+-]([0-9]|0[0-9]|11))\:00$')
cday = datetime.strptime(dt_str,  '%Y-%m-%d %H:%M:%S')
m = re_utc.match(tz_str).group(1)
dt = cday.replace(tzinfo=timezone(timedelta(hours=int(m))))
return dt.timestamp()

  • 1

Reply