datetime to format iso python code example
Example 1: python datetime to utc
from datetime import timezone
timestamp = dt.replace(tzinfo=timezone.utc).timestamp()
Example 2: python datetime to string iso 8601
from datetime import datetime
my_date = datetime.now()
print(my_date.isoformat())