B
B
Blackman2011-11-04 22:25:38
PHP
Blackman, 2011-11-04 22:25:38

Time setting on Debian VPS PHP

There is a Debian server.
I can't set the time.

I tried using
dpkg-reconfigure tzdata
to select Europe / Kiev - no result.

If set to Etc/GMT-2, the date command will display the correct time.
But if output via php, there will be an hour difference:

echo date('Ymd H:i:s');

Any ideas?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
@
@sledopit, 2011-11-04
_

it ?

1
13alex, 2011-11-04
@13alex

pecl install timezonedb This
will help you connect your timezone database to php. It just doesn't use the local date.

C
chmv, 2011-11-04
@chmv

In /etc/php5/apache2/php.inithe section [Date]write date.timezone = Europe/Kiev. As a result, you will get this: If necessary, do the same in .
[Date]
; Defines the default timezone used by the date functions
; php.net/date.timezone
date.timezone = Europe/Kiev

/etc/php5/cli/php.ini

C
chmv, 2011-11-05
@chmv

If I understand the situation correctly, your Debian now lives by the law that was passed and then repealed by the Rada. Changes were made to tzdata in both the first and second cases. I suspect that if you return the Europe/Kiev timezone instead of the currently set Etc/GMT-2, then you will see the FET ( Further-eastern European Time ) timezone in the date output. And it should be EET.
However, you can make sure of this, and now:
zdump -v Europe/Kiev | grep 2011
It should be like this:
[email protected] ~ # zdump -v Europe/Kiev | grep 2011
Europe/Kiev Sun Mar 27 00:59:59 2011 UTC = Sun Mar 27 02:59:59 2011 EET isdst=0 gmtoff=7200
Europe/Kiev Sun Mar 27 01:00:00 2011 UTC = Sun Mar 27 04:00:00 2011 EEST isdst=1 gmtoff=10800
Europe/Kiev Sun Oct 30 00:59:59 2011 UTC = Sun Oct 30 03:59:59 2011 EEST isdst=1 gmtoff=10800
Europe/Kiev Sun Oct 30 01:00:00 2011 UTC = Sun Oct 30 03:00:00 2011 EET isdst=0 gmtoff=7200

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question