Or do it in some form like this:
I personally hate converting dates using MySql functions
function GetTimeStamp(){
return date('YmdHis');
}
function ConvertDate($old_date, $layout = 'l, F j, Y'){
if($old_date>0){
//Remove non-numeric characters that might exist (e.g. hyphens and colons)
$old_date = ereg_replace('[^0-9]', '', $old_date);
//Extract the different elements that make up the date and time
$_year = substr($old_date,0,4);
$_month = substr($old_date,4,2);
$_day = substr($old_date,6,2);
$_hour = substr($old_date,8,2);
$_minute = substr($old_date,10,2);
$_second = substr($old_date,12,2);
//Combine the date function with mktime to produce a user-friendly date & time
$new_date = date($layout, mktime($_hour, $_minute, $_second, $_month, $_day, $_year));
return $new_date;
}
}
$newdate = GetTimeStamp(); //Store in DB
$data_string = ConvertDate($newdate, 'm/d/y'); // Convert timestamp from DB to display