dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Converting UNIX_TIMESTAMP to Readable Format in MySQL

Learn more about a quick and neat way of converting the current time from Unix format to Readable format.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


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

 

Visit the DevX Tip Bank

 





   
Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Thanks for your registration, follow us on our social networks to keep up-to-date