hello,
Could someone please tell me if there is a simple way to convert this date '5/15/2002' to '2002-05-15'? Any help would be great!
Thanks, Kash
$date="2002-05-15"; $pat = "-"; $arr = split($pat, $date); echo $arr[2]."-".$arr[1]."-".$arr[0];
you can also use 'explode' to divide the date and save each into array.
Read this article to get all information about date.
http://www.phpbuilder.com/columns/akent20000610.php3
Try this:
print ereg_replace("([0-9]+)-([0-9]+)-([0-9]+)","\3/\2/\1","5/15/2002");
there is an example almost identical to this in the manual for split() or explode() can't remember which