cday = datetime.strptime(dt_str, '%Y-%m-%d %H:%M:%S') re_time = re.compile(r'^UTC([+|-])(0{0,1}[0-9]|1[0-2])\:00$') re_grps = re_time.match(tz_str).groups() tz_in = timezone(timedelta(hours=int(re_grps[0]+re_grps[1]))) dt = cday.replace(tzinfo=tz_in) return dt.timestamp()
Sign in to make a reply
王珺飞MCFC