title: Python storing and comparing timestamps
body: <p>From what I've researched, it appears storing my timestamps as UTC (not native, full, eg: 2013-01-29 02:11:11.151996+00:00) is the norm. </p>
  
  <p>When retrieving the times, I want to check if a window of time has elapsed. So, </p>
  
  <pre><code>currentTime = datetime.utcnow()
  storedTime  = '2013-01-29 02:11:11.151996+00:00'
  
  if (storedTime + 60) &gt; currentTime:
      print "60 or more has elapsed, do something again"
  </code></pre>
  
  <p>How can I add arbitrary amounts of time do a UTC timestamp, even if it's not a datetime object? Or, how do I create a datetime object from a UTC timestamp, and then add arbirary time to it.</p>
  
  <p>I know once I have two datetime objects I can do d1 > d2. I'm just having trouble getting the objects. </p>
  
  <p>TIA!</p>
  
  <p>Edit/Update:</p>
  
  <p>Thanks everyone. I decided to do the following: (which is a combination of both answers, sorry I can only accept one!)</p>
  
  <pre><code>        lastTime = dateutil.parser.parse(subDict['last'])
          utcNow = datetime.datetime.utcnow().replace(tzinfo=tz.tzutc())
  
          if lastTime + datetime.timedelta(seconds=subDict['interval']) &lt; utcNow:
              print "Time elapsed, do something!"
  </code></pre>