tonomud
12-20-2005, 06:34 PM
I've stored a datetime stamp ( 1997-10-04 22:23:00 ) in a mysql database that I would like to display as a regular date ( October 4, 1997 ) on a page. How do I format my query to do this?
so, let's say that my 'datetime' field is called 'airdate', and the below code is the php code that calls that value:
<?php echo $row_homepage_stories['airdate']; ?>
Is there a simple way to adjust what gets displayed from that output? I looked on the mysql site for some help, and came across this page which seems like it should be helpful, but I'm not sure how to translate the code there to my situation.
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
Based on that page, I think the format that I'd like to use is shown below after the date:
('1997-10-04 22:23:00', '%M %e, %Y');
Can anyone point me in the right direction? Thanks!
so, let's say that my 'datetime' field is called 'airdate', and the below code is the php code that calls that value:
<?php echo $row_homepage_stories['airdate']; ?>
Is there a simple way to adjust what gets displayed from that output? I looked on the mysql site for some help, and came across this page which seems like it should be helpful, but I'm not sure how to translate the code there to my situation.
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
Based on that page, I think the format that I'd like to use is shown below after the date:
('1997-10-04 22:23:00', '%M %e, %Y');
Can anyone point me in the right direction? Thanks!
