Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have noticed, that the Russian timezone is not up-to-date. The GMT offset is set to +3 h now, whereas the current GMT offset is +4 hours. Could someone tell me how can i manually edit the tzdata file to set it up to date?

share|improve this question
add comment

migrated from stackoverflow.com Nov 22 '11 at 16:47

This question came from our site for professional and enthusiast programmers.

2 Answers

The timezone data resides in /usr/share/zoneinfo, but the format is binary and hard to edit. You could try installing the current version of the tzinfo database.

share|improve this answer
add comment

You should perform all updates for your distribution. Every operating system out there repacks the collaborative zoneinfo database, and they usually push updates when laws change.

If your distribution doesn't have an update, you can't edit the files as installed, but you can recompile just this file. Download the latest archive, extract the file for your timezone, and run zic (if your timezone is Europe/Moscow, which it sounds like from your description):

mkdir tmp
cd tmp
tar xzf tzdata2011n.tar.gz europe
zic -d . europe                      # or /usr/sbin/zic if zic isn't in your $PATH

Copy or link the file Europe/Moscow as /etc/localtime. With programs using GNU libc (i.e. almost all programs on a non-embedded Linux system), that's all you need to do. For Java programs, this is not enough; see Debugging Java program for changing timezone configuration file on Ubuntu. Your best bet is to copy the new version of Europe/Moscow over the existing one in /usr/share/zoneinfo.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.