I’ve been working on this for a bit and not seeing the answer quite yet. Essentially, I need to add a conditional depending on a GMT offset into a script. The GMT offset needs to be wherever in the world it is 7 AM at the time the script runs.
In other words, if it’s 7 AM in New York, I need to write a python script that will return ‘-4’.
Any ideas?
UPDATE:
A script like this would work most of the time:
7 - time.gmtime().tm_hour
but when it’s 11 PM (23) in GMT, the return is -15, and there isn’t a GMT offset for -15 (only goes to -12).
1 Answer