title: Converting date and time from String format to Python datetime object: ValueError: time data '... p.m.' does not match format '... %p'
body: <p>I have date and time in the below String format:</p>
  
  <blockquote>
    <p>dateTime = '21-03-2015 12:20 p.m.'</p>
  </blockquote>
  
  <p>And I want to convert it into Python datetime object. I'm doing something like below:</p>
  
  <pre><code>dateTimeObj = datetime.datetime.strptime(dateTime, '%d-%m-%Y %I:%M %p')
  </code></pre>
  
  <p>But I keep getting the below error:</p>
  
  <pre><code>ValueError: time data '21-03-2015 12:20 p.m.' does not match format '%d-%m-%Y %I:%M %p'
  </code></pre>
  
  <p>Just don't seem to get what I'm doing wrong. Any solutions would be greatly appreciated.</p>