Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Thu May 06, 2021 8:30 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - Mysql convert unix timestamp to human readable format
Author Message
Post subject: Mysql convert unix timestamp to human readable format  |  Post Posted: Wed Jan 14, 2015 11:36 am
Mysql and Unix timestamps are numerical values representing number of seconds elapsed since 1st of January 1970.

Mysql: How to get timestamp of current time:
Code:
mysql> select UNIX_TIMESTAMP();
+------------------+
| UNIX_TIMESTAMP() |
+------------------+
|       1421249658 |
+------------------+
1 row in set (0.00 sec)


Mysql: How to convert unix timestamp to human readable format:
Code:
mysql> select FROM_UNIXTIME(UNIX_TIMESTAMP());
+---------------------------------+
| FROM_UNIXTIME(UNIX_TIMESTAMP()) |
+---------------------------------+
| 2015-01-14 17:34:49             |
+---------------------------------+
1 row in set (0.00 sec)


Note that timestamp involving functions in Mysql contain unix as this format is unix time format. More info about mysql date and time functions on mysql website: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO