title: Find out if a date is more than 30 days old
body: <p>I want to know if <code>insertion_date</code> is older than 30 days. This should detect down to the minute and second of the current time. The value in <code>insertion_date</code> will be dynamically pulled from an API.</p>
  
  <p>Current code only detects up to the day, i need the accuracy to up to the second.</p>
  
  <pre><code>import datetime
  import dateutil.parser
  
  insertion_date = dateutil.parser.parse('2017-08-30 14:25:30')
  right_now_30_days_ago = datetime.datetime.today() - datetime.timedelta(days=30)
  
  print right_now_30_days_ago #2017-08-31 12:18:40.040594
  print insertion_date #2017-08-30 14:25:30
  
  if insertion_date &gt; right_now_30_days_ago:
      print "The insertion date is older than 30 days"
  
  else:
      print "The insertion date is not older than 30 days"
  </code></pre>