devxlogo

Converting UNIX_TIMESTAMP to Readable Format in MySQL

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  |+--------------------------------------+ 
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist