Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Comparison/conversion of unix timestamps and literal time values affected by MySQL leap seconds #100
Comments
From r.wetzlmayr on December 25, 2013 01:53:42 Owner: --- |
From r.wetzlmayr on December 23, 2010 11:16:44
==Steps to reproduce==
==Expected output==
Posted = '2010-12-15 11:24:45' as entered in step 1
==Actual output==
Posted = '2010-12-15 11:24:21', i.e. 24 seconds off
==Reason==
MySQL 5.1.31+ accounts for leap seconds on capable O/Ss: http://dev.mysql.com/doc/refman/5.1/en/time-zone-leap-seconds.html . A diret comparison or conversion between timestamps and time literals may lead to unexpected effects.
==Impact==
We convert from time literals to timestamps and vice versa on a whole lot of places. e.g. as we save an article.
We compare with results from MysQLs 'now()', 'unix_timestamp()', timestamps and DATETIME columns at various locations (getNeighbour() [ https://code.google.com/p/textpattern/source/browse/development/4.x/textpattern/publish.php?r=3470#1012 ], list_list() [ https://code.google.com/p/textpattern/source/browse/development/4.x/textpattern/include/txp_list.php?r=3470#292 ] et cetera).
I assume most of these are off by some seconds.
==Additional reading==
MySQL forum post: http://forums.mysql.com/read.php?10,388911,388911 Please use labels and text to provide additional information.
Original issue: http://code.google.com/p/textpattern/issues/detail?id=96