Saturday, August 30, 2008

timezones, part 2

It seems that the government has extended DST until October 31. If you have the latest timezone files installed, your computers will be off by an hour starting September 1. Here's how to fix it.

  • Download the latest timezone data. You can find it here (torrent).
  • Unpack it in an empty directory.
  • Install the zic application, if necessary. On most current systems, it's already installed in /usr/sbin (checked on: FreeBSD, Debian/Ubuntu, Centos, Solaris 10).
  • Make a backup of /etc/localtime and /usr/share/zoneinfo (/usr/share/lib/zoneinfo on Solaris).
  • Edit the asia file, and change "Sep" on line 1548 to "Nov".
  • As root, type zic asia. This will overwrite the files in the zoneinfo directory.
  • Use your system's tools to set the timezone to Asia/Karachi, or simply copy the Asia/Karachi file from the zoneinfo directory over /etc/localtime On FreeBSD and NetBSD, the tool is tzsetup. On most Linux distributions, it's tzselect.
  • You may need to restart system services to make them read the new timezone data.

You're done.

Related:

  • The torrent file contains both a patched copy of the asia file and a diff you can apply with patch.
  • If you don't want to overwrite the system files, type zic -d . asia instead. It'll create the Asia directory in your current directory.
  • On FreeBSD, update your ports and install (or re-install) the misc/zoneinfo package. It will download and install the latest zoneinfo data. You'll still need to run tzsetup or copy the updated file to /etc/localtime.

1 comment:

Anonymous said...

Thanks.Worked for me