Hi there,
sorry if this should be in the database section...I dont know
im trying to breakdown a mySQL date format into something I can pull the various bits out of.
After a long search (its hard when you arent sure exactly what you are searching for) I found this, which from the description, I hoped meant I had beensuccessful. Unfortunately it only kicks out the year for some reason. I looked at the sscanf and list documentation...but to no avail, hell I dont even really know what all the double Ds mean and why year has a four and all the rest have a 2 :-(
Although dont get me wrong I normally dont have anything against Double Ds LOL
Hopefully someone can help me.
$time = $myrow["time"];
list($year,$month,$date,$hour,$min,$sec) = sscanf($time,"%4dd%2dd%2dd%2dd%2dd%2dd");
echo "<br>Time is set to: ".$time;//returns 2004-10-15 14:40:00
echo "<br>Year is set to: ".$year;//returns 2004 as one would expect
echo "<br>month is".$month;
echo "<br>the date is".$date;
echo $hour;
echo $min;
echo $sec;
Thanks for reading!