79675157

Date: 2025-06-22 13:12:12
Score: 1
Natty:
Report link
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)


Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Divyanshi Yadav