Setting the timezone on OpenBSD servers

I have performed a number of OpenBSD installations in the past, and have always used the installer to set the timezone. One system that I recently built didn’t have a timezone set, which required me to run the zic(8) utility manually to change the timezone on the system. To set the servers timezone to Eastern with support for daylight savings time, I executed zic with the “-l” (Use the given time zone as local time) option and the timezone I wanted to use:

$ zic -l EST5EDT

Once the timezone was set, I used the rdate utility to synchronize the time on the server:

$ rdate -nv

If your not certain which timezone to use, you can check the directory /usr/share/zoneinfo. The zoneinfo directory contains the full list of timezones that can be passed to zic.