View Single Post
Old 01-11-2011, 02:54 AM  
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
Quote:
Originally Posted by Dido AskJolene View Post
With regards to the date splitting, using a regexp is ok - however I think just using explode() will/can be quicker. Especially for something this trivial, it doesn't really require a regexp.
That works really well too. From what I understand it's much quicker to use PHP native functions than a regex anyhow? This is what I came up with...

Code:
$oldDate = "1/12/2011";
list ($day, $month, $year) = explode("/", $oldDate); 
$newDate = "$year-$day-$month";
Does the trick. Thnx.
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote