note 30558 modified in function.date by philip
| From: | philip@php.net | Date: | Sat, 02 Aug 2003 15:41:36 +0000 |
| Subject: | note 30558 modified in function.date by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53212@lists.php.net to get a copy of this message | ||
[[Editors note: It's preferred to instead use MySQL's own date and time functions for
this. See:
* http://www.mysql.com/doc/en/Date_and_time_functions.html
]]
Can't believe someone hasn't posted this one! - A simple function for formatting a MySQL
date straight from the database to a proper readable format.
function formatdate($date)
{
list($yyyy, $mm, $dd) = explode('-',$date);
$date = date('F j, Y', mktime(0,0,0,$mm,$dd,$yyyy));
return $date;
}
// echo $date; gives date in the format "October 11, 2003"
--was--
Can't believe someone hasn't posted this one! - A simple function for formatting a MySQL
date straight from the database to a proper readable format.
function formatdate($date)
{
list($yyyy, $mm, $dd) = explode('-',$date);
$date = date('F j, Y', mktime(0,0,0,$mm,$dd,$yyyy));
return $date;
}
// echo $date; gives date in the format "October 11, 2003"
http://www.php.net/manual/en/function.date.php