Friendly Dates with MySQL and PHP
$when = date('F j, Y', strtotime($datetime));
The above code, where the ‘$datetime’ variable is a MySQL datetime stamp, will output a humanized date use PHP’s date(); function.
This entry was posted
on Monday, January 26th, 2009 at 3:22 pm and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed.
MLA: Gruman, Matthew. "Friendly Dates with MySQL and PHP." matthewgruman.com. 2009. matthewgruman.com. 10 Mar. 2010 <http://matthewgruman.com/friendly-dates-with-mysql-and-php/>.
You can leave a response, or trackback from your own site.
« Excuse Rolodex - TV on the Radio – Golden Age (Guitar Chords/Tab) »
Comments
Post a comment