Include timestamp as readable date using SQL (no PHP)

Code snippet for SQL use, to include a formatted version of a timestamp field in database query results.

Code snippet for SQL use, to include a formatted version of a timestamp field in database query results.

SELECT *, DATE_FORMAT(FROM_UNIXTIME(tstamp), '%d.%m.%Y, %H:%i:%s') as readable_date FROM `myTable` WHERE `name` LIKE '%howells%'

23rd May 2012

# # # # # #