timezones, UTC

Time zones are a major source of annoyance for me, when writing code or working with databases that store time-keyed data. It’s especially irritating when you have to deal with the abomination that is daylight savings time.

So, I’ve finally decided to go ahead and set my server clocks to UTC (or GMT). It wasn’t hard to figure out how to do this, but documentation for this specific task was rather sparse as most people seem to want to move away from UTC.

On FreeBSD and Debian (Sarge) Linux, you can do this by copying /usr/share/zoneinfo/Etc/UTC to /etc/localtime . On Debian, you’ll want to replace what is currently in /etc/timezone with the string “Etc/UTC”. Then run ntpdate against your favorite time server, and reboot so all applications have the proper timezone setting.

You’ll need to figure out how you want to set your CMOS clock. I’ve left them as they are, set to local time, because it’s not convenient to load up the BIOS and change them. On FreeBSD, if your CMOS clock is on local time, touch /etc/wall_cmos_clock . If UTC, rm /etc/wall_cmos_clock . On Debian (Sarge) Linux, run “hwclock –localtime” or “hwclock –utc”.

2 Responses to “timezones, UTC”

  1. Sam Habash Says:

    How about your wristwatch? I set mine to UTC (or GMT) a week ago.

    What I really want is a watch that tells me seconds since the epoch!

    –Sam

  2. dpk Says:

    I use my phone for a clock, and am definitely considering it. I also use it for an alarm, so I’ll probably have to go through a “difficult” transition period. It’s one thing to have a server on UTC, but another to coordinate that time with other people.

Leave a Reply