Consider this. On my server, I convert a (UTC/GMT) timestring like this:
strtotime('Fri Feb 18 21:08:38 +0000 2011')
My server returns
1298063318
This is correct, since all unix timestamp converters that I tested, return the same. And vice versa, if I insert not the date but the timestamp, I get returned the timestring as given above. But if I convert the timestamp on my server:
date("Y-m-d H:i:s", 1298063318);
I get back a different date than expected (being 'Fri Feb 18 21:08:38 +0000 2011'):
2011-02-18 22:08:38
So it's off an hour. This is probably because my servers timezone is set at Europe/Paris, and it thus translates the timestamp into UTC/GTM + 1. But MySQL, ran on the same server and having the same timezone, gives me back another result:
SELECT FROM_UNIXTIME(1298063318) = 2011-02-18 22:08:15
In other words, it is off 18 seconds. Can somebody explain why?