Coverting Dates

What is the best way to convert a date stored in a database as 1112277480 to display this format as: 0000-00-00 00:00:00

Thanks!

convert it in the query

SELECT FROM_UNIXTIME(1112277480)

2005-03-31 09:58:00

^ What Rudy said.

But if you need to convert it in PHP for some reason:


$ts = 1112277480;
echo date('Y-m-d H:i:s', $ts);