OpenBSD Set / Configure Time Zone
Q. How do I configure or change timezone under OpenBSD operating system?
A. All of the time zones OpenBSD supports are in the /usr/share/zoneinfo directory tree. You need to create symlink to /etc/localtime file.
=> /usr/share/zoneinfo - time zone information directory
=> /etc/localtime - local time zone file
=> /usr/share/zoneinfo/posixrules - used with POSIX-style TZ's (generally not required)
=> /usr/share/zoneinfo/GMT - for UTC leap seconds
Here is my current timezone - set to Asia / Calcutta (GMT +5:30):
$ ls -l /etc/localtime
Sample output:
lrwxr-xr-x 1 root wheel 33 Sep 19 2007 /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta
How do I change time zone?
You'll see several subdirectories for various countries or continents, each containing either city names or local time zones.
# ls /usr/share/zoneinfo/
Sample output:
Africa Atlantic Canada EST5EDT Factory GMT-0 Iceland Japan MST7MDT Navajo Portugal UCT WET zone.tab America Australia Chile Egypt GB GMT0 Indian Kwajalein Mexico PRC ROC US Zulu Antarctica Brazil Cuba Eire GB-Eire Greenwich Iran Libya Mideast PST8PDT ROK UTC posix Arctic CET EET Etc GMT HST Israel MET NZ Pacific Singapore Universal posixrules Asia CST6CDT EST Europe GMT+0 Hongkong Jamaica MST NZ-CHAT Poland Turkey W-SU right
Find the file for the time zone you like or for a city whose time zone you share. To set the time zone, just create a new symbolic link to the file from /etc/localtime.
# ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Linux, UNIX set the time zone on a per user basis
- Troubleshoot Linux / UNIX bind dns server zone problems with named-checkzone tool
- OpenBSD Change Hostname
- OpenBSD Install Ports Collection
- OpenBSD Set Date and Time
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: /etc/localtime, /usr/share/zoneinfo, /usr/share/zoneinfo/GMT, /usr/share/zoneinfo/posixrules, change time zone, ls command, openbsd zonetime, set time zone ~ Last updated on: May 3, 2008



Recent Comments
Today ~ 17 Comments
Today ~ 2 Comments
Today ~ 37 Comments
Today ~ 46 Comments
Yesterday ~ 2 Comments