Time unixtime in MySQL != PHP, what's the problem?

Good. You need to look for unixtime but there is a problem
MySQL date 2007-06-05 turns into 1180990800
And PHP makes 1181026800

Why and how to fix it.

PS by the way if you take and translate unixdate from muscula using PHP get 2007-06-04 14:00 ... in the other day
July 8th 19 at 16:14
1 answer
July 8th 19 at 16:16
Solution
1181026800 Is equivalent to: 06/05/2007 @ 7:00am (UTC)
1180990800 Is equivalent to: 06/04/2007 @ 9:00pm (UTC)

The difference of exactly two hours 10 hours kakby hints to us that in MySQL and PHP exposed to different timzone (time zones)

Both are configured in the relevant config. Or you can use system time.
: Yes, already have set SET GLOBAL time_zone = 'Europe/Moscow';
I just use another Sphinx, there is a need to specify timzone - kari82 commented on July 8th 19 at 16:37
I may not think so, but the difference is clearly more than 2 hours... the first 5 number, the second number 4... this time
in the second https://yadi.sk/i/F2yy7-F4sKCcF - kari82 commented on July 8th 19 at 16:19
I fixed that, do ten.
In the calculator 1181026800 - 1180990800 = 36000
36000 / 60 = 6,000 minutes or 10 hours. - Austen.Thompson53 commented on July 8th 19 at 16:22
however, that muscul that tag brought me the same time - kari82 commented on July 8th 19 at 16:25
: In what sense? - Austen.Thompson53 commented on July 8th 19 at 16:28
: the screenshot in the first comment... - kari82 commented on July 8th 19 at 16:31
: check all the same timzone.
In mysql SELECT @@global.time_zone, @@session.time_zone;
While in php it is possible in the output of phpinfo() to see the timezone parameter. - Austen.Thompson53 commented on July 8th 19 at 16:34

Find more questions by tags PHPMySQL