Converting UNIX_TIMESTAMP to Readable Format in MySQL

MySQL has lot of support for working with date and time. The following is a quick and neat way of converting the current time from Unix format to Readable format.

Query:

SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), '%a %D %M %Y %h:%i:%s %p') AS 'CURRENT TIME';

Sample Output:

+--------------------------------------+| CURRENT TIME                         |+--------------------------------------+| Tue 24th September 2019 06:21:03 PM  |+--------------------------------------+ 
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: