Answer the question
In order to leave comments, you need to log in
Why is PHP returning a date that doesn't match the system date?
After the time change in Russia, on the server where the Europe/Moscow timezones were everywhere, the time did not change. But after installing tzdate, the system time was fixed, I write in the console date gives the correct time. I write in php -r "echo date('Ymd H:i:s');" I get an hour more.
Reinstalling php does not help.
What do you advise to do.
Answer the question
In order to leave comments, you need to log in
another php.ini works through the console (/etc/php5/cli/) there set the default zone Europe/Moscow
PHP version, what system?
which outputs:
<?php
echo "Default TZ: ", date_default_timezone_get();
$r = new \ReflectionExtension('date');
echo $r->info();
Just struggled with this problem myself (Debian 6, php 5.3.29). Here is my solution (as root):
apt-get install php-pear php5-dev build-essential
pecl install timezonedb
echo "extension=timezonedb.so" > /etc/php5/conf.d/timezonedb.ini
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question