File size: 255 Bytes
cc4ea58
 
 
 
 
 
 
1
2
3
4
5
6
7
8
from datetime import datetime, timezone


# Function to parse RFC 3339 datetime and convert to epoch time
def parse_rfc3339(time_str):
    dt = datetime.fromisoformat(time_str.replace("Z", "+00:00"))
    return dt.replace(tzinfo=timezone.utc).timestamp()