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

It is currently Sun Oct 20, 2019 1:04 pm

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

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
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> how to store select Zulu / UTC timestamp in database
Author Message
Post subject: Mysql> how to store select Zulu / UTC timestamp in database  |  Post Posted: Fri Dec 16, 2011 5:23 am
To obtain/store the current time in mysql, function "NOW()" needs to be used. But this takes into consideration the timezone set on the server.

To store the UTC time, in the same format, "UTC_TIMESTAMP()" function can be used:

mysql> select now();
| now()               |
| 2011-12-16 10:19:33 |
1 row in set (0.00 sec)

mysql> select UTC_TIMESTAMP();
| 2011-12-16 09:19:36 |
1 row in set (0.05 sec)

P.S.: The column type for NOW() and UTC_TIMESTAMP() in mysql is "datetime".
Jump to:  
News 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 ]