note 16214 deleted from function.date by jimw
| From: | jimw@php.net | Date: | Sat, 20 Oct 2001 18:47:58 +0000 |
| Subject: | note 16214 deleted from function.date by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19209@lists.php.net to get a copy of this message | ||
Here is a function I created to convert 14 digit MySQL timestamp to friendly date. I made it for
phpwebthings ( http://phpdbform.com ) , but I think others may
find it useful.
$date is the 14digit MySql timestamp.
function show_date( $date )
{
$year=substr($date,0,4);
$month=substr($date,4,2);
$day=substr($date,6,2);
$hour=substr($date,8,2);
$minute=substr($date,10,2);
$second=substr($date,12,2);
$tstamp=mktime($hour,$minute,$second,$month,$day,$year);
return date("F j, Y, g:i a",$tstamp);
}