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