title: Pandas - Change AM/PM format to 24h
body: <p>I have some time input in the format of <code>'10:23:34 PM'</code> in string and I'd like to convert it to a datetime looking like <code>'22:23:45'</code>. I'm using </p>
  
  <pre><code>datetime = posts['time'].apply(lambda x: datetime.strptime(x, '%I:%M:%S %p').strftime('%I:%M:%S'))
  </code></pre>
  
  <p>However, this seems to disregard the AM/PM markers, and all the info comes out as if the time was in the AM, ergo for the <code>'10:23:34 PM'</code> input I get <code>'10:23:34'</code> as output, but it should be <code>'22:23:45'</code>. How can I fix this?</p>