note 16214 added to function.date

From: Date: Sat, 20 Oct 2001 17:35:24 +0000
Subject: note 16214 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-19204@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); } -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+16214 http://master.php.net/manage/user-notes.php?action=delete+16214 http://master.php.net/manage/user-notes.php?action=reject+16214

« previous php.notes (#19204) next »