Hopefully a simple question, but I've been searching and searching with no luck:
In Python, is there a way to figure out what utc time offset the computer is set to?
Hopefully a simple question, but I've been searching and searching with no luck:
In Python, is there a way to figure out what utc time offset the computer is set to?
gmtime()
will return the UTC time and localtime()
will return the local time so subtracting the two should give you the utc offset.
import time
print time.timezone
It prints UTC offset in seconds (to take into account Daylight Saving Time (DST) see time.altzone.