tags:

views:

22

answers:

2

How can I tell MySQL to format a timestamp as a readable date before outputting a query result in a MySQL client/console?

+4  A: 

Use FROM_UNIXTIME like this:

SELECT
  FROM_UNIXTIME(timestamp_field) AS formatted_date
FROM
  tablename;
Emil Vikström
+1  A: 
SELECT DATE_FORMAT(column_name, '%d/%m/%Y') FROM tablename

Reference

You can also use TIME_FORMAT

kMike