You may find that timestamp value returned by MySQL UNIX_TIMESTAMP() function is 24 seconds grater than those returned by PHP functions and classes like strtotime(), mktime(), DateTime::getTimestamp(), Zend_Date::getTimestamp().
via Why MySQL timestamp is 24 seconds different from PHP | Pumka.net Blog.
Turns out MySQL applies leap seconds, but PHP doesn’t.
4 replies on “Why MySQL timestamp is 24 seconds different from PHP”
Never noticed that, but I probably have hit it from time to time but didn’t realise what was causing my code to break. Thanks!
Yeah, makes me wonder how many times I may have been hit by this and not noticed.
Joseph, thanks for referring to me.
It was a discovery for me too.
No problem, that was a handy piece of information to know about.