In my MySQL table, I have a timestamp column with values like “2008-05-28 00:39:40”. First, I must remove all the formatting:
$delimeters = array('-', ' ', ':');
$time = str_replace($delimeters, '', $new['time']);
echo $time;
// 20080528003940 is displayed
Then I attempt to use the date function on this, but it gives me a weird date in the future:
echo date('M, j, Y', $time);
// Jan, 19, 2038 is displayed