Answer the question
In order to leave comments, you need to log in
Where does PHP get the timezone from on Windows?
There is a test machine with a web server under vin7 with the latest updates. There is PHP 5.4.30 which outputs in response to such a script
...
?><pre><? print_r(new DateTime()) ?></pre><?
...
DateTime Object
(
[date] => 2014-11-10 18:42:52.000000
[timezone_type] => 3
[timezone] => Europe/Moscow
)
Answer the question
In order to leave comments, you need to log in
I will answer myself - in version php 5.4.34 the problem is fixed
Is it the first line in the script? Maybe you have a time zone of +2, and above in the scripts somewhere it is written
ini_set('date.timezone' , "Europe/Moscow"); Then PHP can translate the time. Plus, another web server (IIS or whatever you have) can set the time. Go through the chain, see that the time zone matches everywhere. Also run in the console php -r 'var_dump(new DateTime());'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question