I am trying to take and set a variable called $date to a field in a MySQL table which works and prints out fine. But when I try to use the date(%d, %m $y ,$date); it dosn't work. It returns so very wierd results. My goal is to take the date and display it more readably and I have no clue how to do this my date currently is display like this "20020730113043".
Any help would be greatly appreciated.
function mysql_timestamp_to_date($mysqldate) { $yr=substr($mysqldate,0,4); $mo=substr($mysqldate,4,2); $da=substr($mysqldate,6,2)); return "$mo/$da/$yr"; }
echo mysql_timestamp_to_date("20020730113043");
Thank you.