I have two values created from strftime as below
TIMEFORMAT=\"%Y-%m-%d %H:%M:%S\"
time1 = time.strftime(TIMEFORMAT)
time2 = time.strftime(TIMEFORMAT)
Hope this helps you:
In [1]: from datetime import datetime, timedelta
In [2]: nd = datetime.now()
In [3]: pd = nd - timedelta(hours=1)
In [4]: snd = nd.strftime("%Y-%m-%d %H:%M:%S")
In [5]: spd = pd.strftime("%Y-%m-%d %H:%M:%S")
In [6]: print(snd, spd)
('2013-11-22 15:21:22', '2013-11-22 14:21:22')
In [7]: datetime.strptime(snd, "%Y-%m-%d %H:%M:%S") > datetime.strptime(spd, "%Y-%m-%d %H:%M:%S")
Out[7]: True