* The cover image is originally by Tentes and edited with great appreciation.
This post is about how to check and configure the timezone in OpenBSD.
- OS: OpenBSD 6.4 amd64
Let's check the current timezone with
$ date Mon Dec 3 13:43:30 UTC 2018
We have UTC.
According to OpenBSD - TZSET(3),
/etc/localtimeis "local time zone file".
/usr/share/zoneinfois "time zone information directory".
Then, let's investigate why it is by checking
$ ls -l /etc/localtime lrwxr-xr-x 1 root wheel 23 Jun 12 21:27 /etc/localtime -> /usr/share/zoneinfo/UTC
Now we know it is because
/etc/localtime is linked to
How can we configure the timezone?
Let's change the link with
# ln -fs /usr/share/zoneinfo/%your-location% /etc/localtime
In my case in Japan:
# ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
The result is:
$ date Mon Dec 3 22:56:30 JST 2018
If you have need to change the time zone, you can create a new symbolic link to the appropriate time zone file in /usr/share/zoneinfo.
Happy serving 🕊