6

I take a lot of different MOOC and each class declare own deadline relative to some time zone.

Are there any Emacs mode that show date/time in buffer for several selected time zones in same time?

I expect that mode should understand usual time zone names like UTC+2, EET. See https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations

Also mode should display time in different formats (ISO and American AM/PM). I miss one deadline on half hour just because I didn't know what is 12:59 AM (I think it should be at noon but actually it on deep night).

gavenkoa
  • 3,352
  • 19
  • 36

3 Answers3

6

I start typing different keywords in M-x and see completion to:

display-time-world

That is mostly what I look for:

display-time-world is an interactive autoloaded compiled Lisp function in
`time.el'.

(display-time-world)

Enable updating display of times in various time zones.
`display-time-world-list' specifies the zones.
To turn off the world time display, go to that window and type `q'.

Unfortunately display-time-world-list is an alist (TIMEZONE LABEL) and TIMEZONE should be in a format supported by your system.

There is timezone-world-timezones. Docs for that variable correctly states that TZ abbreviations are ambiguous (same abbreviation was used for different offsets).

With:

(mapc (lambda (el) (add-to-list 'display-time-world-list el))
      '(("EET" "EET")
        ("PST" "PST")))

I have first part of requested. Unfortunately %p formater (for AM/PM) always empty.

gavenkoa
  • 3,352
  • 19
  • 36
2

I guess you are looking for display-time-world-time-format. My setting is:

(setq display-time-world-time-format "%Z\t%a %d %b %R")

And the output of display-time-world is some like this:

Sydney    AEST  Fri 28 Jul 20:27

That's 24-hour format

Lungang Fang
  • 231
  • 2
  • 4
1

display-time-world is will be deprecated in favour of world-clock in the upcoming release, Emacs 28.

Similarly, the configuration variables will also be renamed:

  • display-time-world-list --> world-clock-list
  • display-time-world-time-format --> world-clock-time-format

One example configuration would then be this:

  (setq world-clock-list
    '(
      ("Australia/Melbourne" "Melbourne")
      ("Asia/Calcutta" "India")
      ("America/Chicago" "Chicago")
      ("Asia/Kathmandu" "Kathmandu")
      ("Etc/UTC" "UTC")))

  (setq world-clock-time-format "%a, %d %b %I:%M %p %Z")
Drew
  • 75,699
  • 9
  • 109
  • 225
Hemanta
  • 11
  • 1