title: bad directive error when converting string to_datetime in python
body: <p>I've got the following line of code</p>
  <pre><code>df['Sent Date'] =  pd.to_datetime(df['Sent Date'], format = '%-m/%-d/%Y %-I:%M:%S %p')
  </code></pre>
  <p>trying to convert these sort of strings to datetime
  <code>1/1/2021  2:20:00 PM</code></p>
  <p>I get the following error</p>
  <blockquote>
  <p>'-' is a bad directive in format '%-m/%-d/%Y %-I:%M:%S %p'</p>
  </blockquote>
  <p>Also tried</p>
  <pre><code>import datetime
  df['Sent Date'] = datetime.strptime(df['Sent Date'], '%-m/%-d/%Y %-I:%M:%S %p')
  </code></pre>
  <p>and got the error</p>
  <blockquote>
  <p>'module 'datetime' has no attribute 'strptime'</p>
  </blockquote>
  <p>From viewing other questions/answers I thought one of these approaches would work ...</p>