note 18996 deleted from function.date by sniper

From: Date: Sat, 11 Oct 2003 16:49:01 +0000
Subject: note 18996 deleted from function.date by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58246@lists.php.net to get a copy of this message
Note Submitter: hecky@hecky.com ---- Read further if you are getting dates far away into the future (2033). If you want to get a Timestamp (20020231164333 format) from a mysql database and format it into a readable output, use this command on your mySQL query, assuming you have something like SELECT lastaccesstime FROM user WHERE userid= 'hecky'; change it to SELECT date_format(lastaccesstime, '%M %e, %Y') FROM user WHERE userid = 'hecky'; this will format the date to a Month, date year. the % options should be the same as PHP ones, %M = month, %i = minutes, %Y = year , etc. As with PHP's date() function you customize the format. eg 'Year is %Y, and month is %M' =Year is 2002,and month is February Hope this helped

« previous php.notes (#58246) next »