from datetime import datetime, timezone
def convert_iso8601_to_epoch(ts):
dt = datetime.fromisoformat(ts)
# Convert to UTC timestamp (epoch seconds)
return dt.timestamp()
ts = '2012-09-30T15:31:50.262-08:00'
epoch time = convert_iso8601_to_epoch(ts)
print(epoch_time)