Hi,
After having fetched a TimeStamp field, I can perform some computations and display it with something like : date ( $format, $row[0] );
But I can't find how to do the same with a DateTime. Should I convert it before and how ?
I would like to avoid the workaround to select from the database both the value, and the Mysql formatted value.
Thanks for help.
How to format a DateTime MySql Field ?
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
MySQL has some handy Date and Time functions:
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
For formatting for display I tend to use DATE_FORMAT(), if, however, I'm going to need to manipulate the date once it's been extracted then UNIX_TIMESTAMP() comes in handy.
Mac
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
For formatting for display I tend to use DATE_FORMAT(), if, however, I'm going to need to manipulate the date once it's been extracted then UNIX_TIMESTAMP() comes in handy.
Mac