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