notes from /dev/null

by Charles Choi 최민수


Setting the Timezone in Emacs

12 Nov 2026  Charles Choi

Here’s the problem: You are traveling in a different time zone from the Emacs server instance you are accessing remotely via emacsclient. All clock calculations in that Emacs session are using the local timezone relative to where the server is located. But what you really want is emacsclient to use the current timezone you are in, so things like the mode line clock render accordingly.

To adjust the timezone in an Emacs session, use the command setenv to set the environment variable TZ with a timezone defined in the zoneinfo database. This can be called from Elisp as shown below.

1
(setenv "TZ" "Asia/Seoul")

The latest v3.1.0 update of Casual adds the command casual-timezone-set-tz that provides a completion interface for selecting a timezone to pass to setenv.

1
M-x casual-timezone-set-tz RET

Note that setting TZ impacts the Emacs session globally; any other running behavior depending on a clock should be taken into account.

emacs

 

About • Mastodon • Bluesky • GitHub

Feeds & Tags •
Get Scrim for macOS • Get Captee for macOS

Powered by Pelican