title: How to check if a date is earlier than today's date
body: <p>I have a program that runs a Windows "net user" command to get the expiration date of a user.  For example: "net user justinb /domain"</p>
  
  <p>The program grabs the expiration date.  I am taking that expiration date and setting it as variable <strong>datd</strong></p>
  
  <p>In the example below, we'll pretend the expiration date given was 1/10/2018.  (Note: Windows does not put a 0 in front of the month)</p>
  
  <pre><code>import time
  
  datd = "1/10/2018"
  
  # places a 0 in front of the month if only 1 digit received for month
  d = datd.split("/")
  if len(d[0])==1:
      datd="0"+datd
      print("Changed to: " + datd)
  
  myDate = (time.strftime("%m/%d/%Y"))
  
  print ("This is today's date: " + myDate)
  
  if datd &lt;= myDate:    # if datd is is earlier than todays date
      print (" Password expired. ")
  else:
      print (" Password not expired. ")
  
  input(" Press Enter to exit.")
  </code></pre>
  
  <p>Right now, it gives me correct information if <strong>datd</strong> equals a date in 2017.  I am getting a problem with the year 2018 and on though.  It is telling me that 1/10/2018 comes before today's date of 10/24/2017.
  Is there a way I change the format of the dates properly so that they are read correctly in this program?</p>
  
  <p>I want the output to say that the <strong>"Password is not expired" if datd = 1/10/2018</strong></p>