Hi,
I am storing dates in mysql as unix timestamps. When I am doing select staments how do i get that unix timestamp converted to this format ?
Format is: yyyy-MM-dd HH:mm:ss
Thanks.
| SitePoint Sponsor |



Hi,
I am storing dates in mysql as unix timestamps. When I am doing select staments how do i get that unix timestamp converted to this format ?
Format is: yyyy-MM-dd HH:mm:ss
Thanks.




You would use DATE_FORMAT() ie: SELECT DATE_FORMAT(date,format) FROM tblname.
http://www.w3schools.com/sql/func_date_format.asp


Bookmarks