Discuss / Python / .

UTOO_NAIVE

#1 Created at ... [Delete] [Delete and Lock User]

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()


  • 1

Reply