utc time python code example
Example 1: timestamp python
from datetime import datetime
# current date and time
now = datetime.now()
timestamp = datetime.timestamp(now)
print("timestamp =", timestamp)
Example 2: python - oordinated universal time
from datetime import datetime, timezone
print(datetime.now()) # timezone
print(datetime.now(timezone.utc)) # coordinated universal time