Topic: Incorrect time for Russia/Moscow timezone on server

Hello!

Now Russia/Moscow use MSK (GMT+4) timezone, how to fix it? Please help!

Share

Re: Incorrect time for Russia/Moscow timezone on server

First of all you should update your ports tree. If you never updated it, run:

# portsnap fetch extract
# portsnap fetch update

Else run:

# portsnap fetch update

Then you need to install port zoneinfo:

# cd /usr/ports/misc/zoneinfo
# make install clean
# rehash

If you are using php, you need to intall pecl-timezonedb:

# cd /usr/ports/misc/pecl-timezonedb/
# make install clean
# rehash

Check /usr/local/etc/php/extensions.ini for string:

extension=timezonedb.so

Check /usr/local/etc/php.ini for string:

date.timezone = "Europe/Moscow"

If you use MySQL you need to update its tz tables:

# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot_password mysql

Now you can reboot your server.

Last edited by Mike (2011-11-04 04:52:17 pm)