I have a datetime column in MySQL let's call it $time
. It's coming form a CakePHP form. If I try to echo it I get I just get "Array". If I print_r()
on it I get:
Array ( [month] => 10 [day] => 30 [year] => 2010 [hour] => 16 [min] => 30 )
I want to echo this out as a formatted date, nothing seems to work because it's not a string but an array. Do I have to go like this:
echo $time['month'].'-'.$time['day'].'-'.$time['year'].' '.$time['hour'].':'.$time['min'];
or can I use the date
function?