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
You would use DATE_FORMAT() ie: SELECT DATE_FORMAT(date,format) FROM tblname.
that's not enough -- you also have to convert the unix timestamp to a datetime value
you could nest FROM_UNIXTIME inside DATE_FORMAT, but luckily, FROM_UNIXTIME also accepts a format string, so you could just use it by itself
FROM_UNIXTIME did the trick.
This topic is now closed. New replies are no longer allowed.