How to get the right datetime format if this is the current format 'Sat 18 May, 4:18 am'?
<p>I want to convert 'Sat 18 May, 4:18 am' to MySQL datetime format('Y-m-d H:i:s').</p>

<pre><code>$post_datetime = 'Sat 18 May, 4:18 am';
$format        = 'Y-m-d H:i:s';
$dt            = new DateTime($post_datetime);

echo $dt-&gt;format($format);
</code></pre>

<p>The problem is the formatted datetime is in future <code>2016-05-21 04:18:00</code>. I'm assuming this is because there is no year specified. Any solution?</p>