title: Convert YYYY-MM-DD HH:MM:SS to YYYY-MM-DD python
body: <p>I'm trying to convert </p>
  
  <pre><code>YYYY-MM-DD HH_MM_SS
  </code></pre>
  
  <p>to </p>
  
  <pre><code>YYYY-MM-DD 
  </code></pre>
  
  <p>example:</p>
  
  <pre><code>from datetime import datetime, timedelta
  from dateutil.relativedelta import relativedelta
  i=0
  var="2016-05-03"
  while i &lt; 5
  new_date = datetime.strptime(var, "%Y-%m-%d") + relativedelta(days=i)
  i=i+1
  print(new_date)
  </code></pre>
  
  <p>in this example I would like to convert new_date to string YYYY-MM-DD. I have tried many option, none of them worked...</p>
  
  <p>I thought it will be quite easy but it is not, how to handle with that ? </p>