title: Minutes or Seconds without a leading 0 PHP
body: <p>I am in the midst of changing the dates in my database to something else. However, when getting them to convert to the new style, I notice that some of them are missing a leading 0 for the minutes or seconds.</p>
  
  <pre><code>$origDate = Sat Jan 19 16:15:3 2019
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$origDate = Sat Jan 19 16:8:39 2019
  </code></pre>
  
  <p>This will fail because its looking for a leading 0. How can I fix this?</p>
  
  <pre><code>$oldDate = DateTime::createFromFormat('l M d H:i:s Y', $origDate);
  $origDate = $oldDate-&gt;format('Y-m-d H:i');
  </code></pre>