logo-mysql-heure-date

Convert timestamp to Date readable format in MySQL query

SQL query to convert timestamp to date readable format, which is stored in MySQL database.

SELECT t.*, DATE_FORMAT(FROM_UNIXTIME(t.enteredOn), ‘%e %b %Y’) AS formated_date FROM tbl_sample AS t;

For the detailed reference on DATE_FORMAT() and FROM_UNIXTIME()

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">