title: Python: How can I convert string to datetime without knowing the format?
body: <p>I have a field that comes in as a string and represents a time. Sometimes its in 12 hour, sometimes in 24 hour. Possible values:</p>
  
  <ol>
  <li>8:26</li>
  <li>08:26am</li>
  <li>13:27</li>
  </ol>
  
  <p>Is there a function that will convert these to time format by being smart about it? Option 1 doesn't have am because its in 24 hour format, while option 2 has a 0 before it and option 3 is obviously in 24 hour format. Is there a function in Python/ a lib that does:</p>
  
  <pre><code>time = func(str_time)
  </code></pre>