notes from /dev/null

by Charles Choi 최민수


ICYMI: Emacs World Clock

06 Oct 2023  Charles Choi

If online conferencing and chat are enmeshed in your daily life, invariably you'll run into interaction across different time zones. Wanting to know what time it is “over there” is a frequent question. If you use (or perhaps more accurately, live) in Emacs, the built-in command world-clock answers it.

M-x world-clock creates a new Emacs window displaying the current time (lazily auto-refreshed) in different time zones as shown below.

screenshot showing Emacs world-clock.

You can specify which time zones are displayed by world-clock by customizing the variable world-clock-list.

When world-clock-list is customized with user-specified time zones, its type is an association list whose elements have the form (TIMEZONE LABEL). TIMEZONE is a tz database name and LABEL is an arbitrary string that is usually mapped to a city within that TIMEZONE. On Unix-based systems, you can derive a specific TIMEZONE from inspecting the directory structure of /usr/share/zoneinfo. Personally, I use M-x customize-option to set world-clock-list as shown below.

screenshot showing customizing world-clock-list in Emacs.

world-clock has been around since Emacs 28.1 (actually it was a renaming of the less-discoverable command display-time-world) and is a command that I use routinely. If you work with folks in other time zones and live in Emacs, you'll probably find world-clock to be an essential command.

References

emacs

 

AboutMastodonInstagramGitHub

Feeds & TagsGet Captee for macOS

Powered by Pelican