note 17498 added to function.date
| From: | eric at evilwalrus dot com | Date: | Tue, 11 Dec 2001 21:45:56 +0000 |
| Subject: | note 17498 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-22517@lists.php.net to get a copy of this message | ||
After playing with another example I found here in the manual, you can successfully use a timestamp
from a MySQL database and format it using this:
function time_format($timestamp)
{
$hour = substr($timestamp,8,2);
$minute = substr($timestamp,10,2);
$second = substr($timestamp,12,2);
$month = substr($timestamp,4,2);
$day = substr($timestamp,6,2);
$year = substr($timestamp,0,4);
$mktime = mktime($hour, $minute, $second, $month, $day, $year);
$formated = date("F j, Y, g:i a",$mktime);
return $formated;
}
--
http://www.php.net/manual/en/function.date.php
http://master.php.net/manage/user-notes.php?action=edit+17498
http://master.php.net/manage/user-notes.php?action=delete+17498
http://master.php.net/manage/user-notes.php?action=reject+17498