note 17498 deleted from function.date by philip

From: Date: Tue, 11 Dec 2001 23:07:30 +0000
Subject: note 17498 deleted from function.date by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22518@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; }

« previous php.notes (#22518) next »