First you need to modify the SQL query to use MySQL's UNIX_TIMESTAMP() function. So if your SQL looks like:
SELECT author, `when` …
then convert it to:
SELECT author, UNIX_TIMESTAMP(`when`) …
Then use PHP's date() function to convert the unix timestamp to appropriate display format like this:
date("F j, Y, g:i a", $row[1])
where $row[1] contains the timestamp column value.

No comments:
Post a Comment