title: Convert dates to %y-%m-%d format in Python
body: <p>I have a csv file with column 'date' which has dates in many different formats like ddmmyy, mmddyy,yymmdd. I want to convert all the dates to y-m-d format</p>
  <pre><code>df=pd.read_csv(file)
  df=df['date] .dt.strftime(%y-%m-%d)
  </code></pre>
  <p>This code gives error: &quot;Can only use .dt accessor with datetimelike values&quot;</p>
  <p><a href="https://i.stack.imgur.com/q7DSP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q7DSP.png" alt="enter image description here" /></a></p>