Quote:
Originally Posted by Angry Jew Cat
Code:
$oldDate = "1/12/2011";
list ($day, $month, $year) = explode("/", $oldDate);
$newDate = "$year-$day-$month";
|
The code is perfect for what you want to do, except that it's YYYY-MM-DD in mysql, not YYYY-DD-MM (
http://dev.mysql.com/doc/refman/5.1/en/datetime.html )
so it should be
Code:
$oldDate = "1/12/2011";
list ($day, $month, $year) = explode("/", $oldDate);
$newDate = "$year-$month-$day";