Python current time comparison with other time
<p>I am looking for a comparison of two times in Python. One time is the real time from computer and the other time is stored in a string formatted like <code>"01:23:00"</code>.</p>

<pre><code>import time

ctime = time.strptime("%H:%M:%S")   # this always takes system time
time2 = "08:00:00"

if (ctime &gt; time2):
    print "foo"
</code></pre>

<p><a href="https://docs.python.org/2/library/datetime.html" rel="nofollow">https://docs.python.org/2/library/datetime.html</a></p>

<p>The <code>datetime</code> module will parse dates, times, or combined date-time values into objects that can be compared.</p>

python python-2.7 datetime