Menu

Permanent Tourist

A personal website by Mark Howells-Mead

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.

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