Thursday, February 18, 2010

Date format converting Code In PHP

In database date are stored with a format like 0000-00-00.But sometime we need to change the format.The following function help you to change the time format.

function dateFormat($Date)

{

$Date =explode("-",$Date);

$new_date= $Date[2]."/".$Date[1]."/".$Date[0]; //date format will be like21/12/2010

return $new_date ;

}

No comments: