title: how to convert string to date pandas python TypeError: strptime() takes no keyword arguments
body: <p>I have a dataframe with some text dates in them. I would like to return the dates: year, month and day in separate columns. But in order to do that I need to first convert the text(from excel) to a date.</p>
  
  <p>The code I have now is</p>
  
  <pre><code>def convertdate(dstring):
      dt = time.strptime(dstring, date_format='%Y-%m-%d')
      return dt
  </code></pre>
  
  <p>However it returns an: <code>TypeError: strptime() takes no keyword arguments</code></p>
  
  <p>Then instead of three separate functions for creating three separate columns, one for year, one for month, one for day.</p>
  
  <p>Once the string is a date time object (dt), I believe the code is: <code>return dt.year, return dt.month, return dt.day</code>.</p>
  
  <p>I would like one function which adds three columns to my dataframe, is this possible?</p>