note 76415 deleted from function.date-format by derick
| From: | derick@php.net | Date: | Tue, 13 May 2008 20:12:48 +0000 |
| Subject: | note 76415 deleted from function.date-format by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139352@lists.php.net to get a copy of this message | ||
Note Submitter: muthuishere at gmail dot com
----
You can format Date by using the below function
This function will be helpful for formatting the date after obtaining the date from MYSQL , or if
you need to display the user a formatted date...
function Formatdate($rawdate,$format){
/*
$rawdate - The Date which should be formatted...
$format - The format string....
refer the Date function for format String
*/
$dateTime = new DateTime($rawdate);
$formatted_date=date_format ( $dateTime, $format );
return $formatted_date;
}