Return to Snippet

Revision: 5944
at April 15, 2008 14:34 by isaac


Initial Code
//This code is extracted from the comments on the php.net docs
// Date: d-m-y => y-m-d

$time =explode("-","12-04-2008");
	krsort($time);
	print "<p>".implode("-",$time)."</p>";

//Will return: 2008-04-12.

Initial URL
http://www.php.net/manual/es/function.date.php#81946

Initial Description
This changes the date format from d-m-y to y-m-d on PHP. It's easy to change the - to / or spaces...

Initial Title
Easy transform date format d-m-y => y-m-d on PHP

Initial Tags
php, date, format

Initial Language
PHP