def to_timestamp(dt_str, tz_str): dt = datetime.strptime(dt_str,'%Y-%m-%d %H:%M:%S') utc_dt = dt.replace(tzinfo=timezone(timedelta(hours = int(re.split(r'[C\:]',tz_str)[1])))) utc_dt_timestamp = utc_dt.timestamp() return utc_dt_timestamp
Sign in to make a reply
greatzues