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 | |
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 | |
Note that setting TZ impacts the Emacs session globally; any other running behavior depending on a clock should be taken into account.