def to_timestamp(dt_str, tz_str): dt = datetime.strptime(dt_str, '%Y-%m-%d %H:%M:%S') tz_hour = int(tz_str[3:].split(':')[0]) tz_utc = timezone(timedelta(hours = tz_hour)) return dt.replace(tzinfo = tz_utc).timestamp()
Sign in to make a reply
纸丶两面白