get utc time python code example
Example 1: python - oordinated universal time
from datetime import datetime, timezone
print(datetime.now()) # timezone
print(datetime.now(timezone.utc)) # coordinated universal time
Example 2: get UTC time for IST time python
UTC_datetime_converted = datetime.datetime.utcfromtimestamp(local_datetime_timestamp)