def to_timestamp(dt_str, tz_str): cday = datetime.strptime(dt_str, '%Y-%m-%d %H:%M:%S') m=re.match(r'UTC(.\d+):(\d+)',tz_str) h=int(m.group(1)) tz_utc = timezone(timedelta(hours=h)) dt = cday.replace(tzinfo=tz_utc) return dt.timestamp()
Sign in to make a reply
°Destiny