def to_timestamp(dt_str, tz_str): the_time = datetime.strptime(dt_str, '%Y-%m-%d %H:%M:%S') n = re.findall('UTC(.*):\d\d',tz_str)[0] n = int(n) tz_utc_n = timezone(timedelta(hours=n)) dt = the_time.replace(tzinfo=tz_utc_n) return dt.timestamp()
Sign in to make a reply
快没时间啦