Execute function at specific GMT time daily
<p>How can I implement what is described in the tittle in python, regardless of when the initial script will be run?<br>
For example if I run the script at 2 am in a <code>"GMT +2"</code> timezone or at 8 pm at a <code>"GMT -1"</code> timezone, this script must schedule a function to run every day at <code>GMT 00:00</code>.</p>

<p>You can just use <code>strftime</code> and <code>gmtime</code> (GMT):</p>

<pre><code>from time import strftime, gmtime
def foo():
    if strftime("%H%M", gmtime()) == "0000": # Gets time in this format: HHMM
        # Do stuff
</code></pre>

<p>For more information, go to <a href="https://docs.python.org/2/library/time.html#time.strftime" rel="nofollow">here</a> (Python docs).</p>

python time