title: Converting string to datetime with strptime in Python
body: <p>I'm trying to convert a string to datetime with <strong>dd/mm/YYYY</strong> format, but the function &quot;strptime&quot; seems isn't working properly. The result format isn't in the same that i am specifying in the function.</p>
  <pre><code>import datetime
  from datetime import datetime
  from datetime import date
  
  today = date.today()
  print (today)
  today = today.strftime(&quot;%d-%m-%Y %H:%M:%S&quot;)
  print (today)
  
  today = datetime.strptime(today, &quot;%d-%m-%Y %H:%M:%S&quot;)
  print (today)
  </code></pre>
  <p>My <strong>output</strong> is this:</p>
  <pre><code>2022-08-26
  26-08-2022 00:00:00
  2022-08-26 00:00:00
  </code></pre>
  <p>it seems that after the <strong>strftime</strong> function, the format is right, but when i call the <strong>strptime</strong> function, its getting back to the previous format <strong>&quot;YY-mm-dd&quot;</strong></p>