title: Comparing dates not working as expected in Python
body: <p>I am trying to compare a date I extracted from a csv file to the current date, to check if the difference is bigger than seven days. Here is my code:</p>
  
  <pre><code>with open (path) as csvfile:
      readcsv = csv.reader(csvfile, delimiter = ',')
      for row in readcsv:
          iso_ts = str(row[3])
          datum = (datetime.datetime.strptime(''.join(iso_ts.rsplit(':', 1)), '%Y-%m-%dT%H:%M:%S%z'))
  
      current_time = (datetime.datetime.strptime(datetime.datetime.now(),'%Y-%m-%dT%H:%M:%S%z'))
  </code></pre>
  
  <p>Without even comparing these I get the following error</p>
  
  <pre><code>File "./netapp.py", line 32, in &lt;module&gt;
      current_time = (datetime.datetime.strptime(datetime.datetime.now(),'%Y-%m-%dT%H:%M:%S%z'))
  TypeError: must be str, not datetime.datetime
  </code></pre>
  
  <p>I would like to check, if the data coming from the csv is older than 7 days to the current date and then do something. I know this is some problem with the format of either one of these dates, but i can not seem to figure out what it is exactly. I would be very grateful for an explanation about what I am missing. </p>