Reputation: 13226
How can I tell MySQL to format a timestamp as a readable date before outputting a query result in a MySQL client/console?
Upvotes: 5
Views: 18251
Reputation: 1054
SELECT DATE_FORMAT(column_name, '%d/%m/%Y') FROM tablename
You can also use TIME_FORMAT
Upvotes: 5
Reputation: 91983
Use FROM_UNIXTIME like this:
SELECT
FROM_UNIXTIME(timestamp_field) AS formatted_date
FROM
tablename;
Upvotes: 11