note 30558 deleted from function.date by sniper

From: Date: Sat, 11 Oct 2003 16:53:19 +0000
Subject: note 30558 deleted from function.date by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58284@lists.php.net to get a copy of this message
Note Submitter: nigelNOSPAM@webleicester.co.uk ---- [[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"

« previous php.notes (#58284) next »