def to_timestamp(dt_str, tz_str): hours = re.match(r'UTC([\+\-]?\d{0,2}):\d*',tz_str).group(1) d = datetime.strptime(dt_str,'%Y-%m-%d %H:%M:%S') tz_utc = timezone(timedelta(hours=int(hours))) d = d.replace(tzinfo=tz_utc) return d.timestamp()
Sign in to make a reply
世代相传的锅盖头