aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2025-09-14 10:06:51 -0700
committerPaul Eggert2025-09-14 10:14:58 -0700
commit897d32285fc17b8afd889b1f733aed7149b50a5c (patch)
tree48cd3bfa4842e641888dc67229cdb5e19cfb6e81
parent04342d365406468b9d82ad81277f20d5bfd0eb4d (diff)
downloademacs-897d32285fc17b8afd889b1f733aed7149b50a5c.tar.gz
emacs-897d32285fc17b8afd889b1f733aed7149b50a5c.zip
Fix incorrect timezones for London and Paris
Also, replace obsolete city name "Bangalore" with "Delhi", and improve doc strings. * lisp/time.el (zoneinfo-style-world-list) (legacy-style-world-list): Evidently "Bangalore" was chosen for Asia/Kolkata to avoid confusion about "Calcutta" vs "Kolkata". However, it has similar confusion with "Bengaluru". Use "Delhi" instead, as Delhi is larger, its name has not changed for some time, and proposals to change its name have so far failed. See: Sharma MS. Vijay Goel wants Delhi renamed as Dilli, but historians say it will only spell trouble. Times of India. 2019-07-25. (zoneinfo-style-world-list): Update doc string. “Posix-style” was ambiguous as TZDB-style strings are specified only by POSIX.1-2024, so use “TZDB-style” instead. Say “AREA/LOCATION” to be consistent. If AREA/LOCATION is unsupported, Emacs signals an error on NetBSD so don’t imply that some other timezone will be used. (legacy-style-world-list): Remove ("GMT0BST" "London") and ("CET-1CDT" "Paris"). These are wrong because neither London nor Paris follow US DST rules. Instead, use ("GMT0BST,M3.5.0/1,M10.5.0" "London") and ("CET-1CEST,M3.5.0,M10.5.0/3" "Paris") if they work, and omit London and Paris entries otherwise.
-rw-r--r--lisp/time.el36
1 files changed, 23 insertions, 13 deletions
diff --git a/lisp/time.el b/lisp/time.el
index 517eea20ad1..ecacaf08aa4 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -452,7 +452,7 @@ runs the normal hook `display-time-hook' after each update."
452 ("America/New_York" "New York") 452 ("America/New_York" "New York")
453 ("Europe/London" "London") 453 ("Europe/London" "London")
454 ("Europe/Paris" "Paris") 454 ("Europe/Paris" "Paris")
455 ("Asia/Kolkata" "Bangalore") 455 ("Asia/Kolkata" "Delhi")
456 ("Asia/Tokyo" "Tokyo")) 456 ("Asia/Tokyo" "Tokyo"))
457 "Alist of zoneinfo-style time zones and places for `world-clock'. 457 "Alist of zoneinfo-style time zones and places for `world-clock'.
458Each element has the form (TIMEZONE LABEL). 458Each element has the form (TIMEZONE LABEL).
@@ -461,27 +461,37 @@ the name of a region -- a continent or ocean, and LOCATION is the name
461of a specific location, e.g., a city, within that region. 461of a specific location, e.g., a city, within that region.
462LABEL is a string to display as the label of that TIMEZONE's time. 462LABEL is a string to display as the label of that TIMEZONE's time.
463 463
464This option has effect only on systems that support Posix-style 464This option has effect only on systems that support TZDB-style
465zoneinfo files specified as CONTINENT/CITY. In particular, 465TZ strings specified as AREA/LOCATION. In particular,
466MS-Windows doesn't support that; use `legacy-style-world-list' instead. 466MS-Windows doesn't support that; use `legacy-style-world-list' instead.
467Also, AREA/LOCATION must specify a zoneinfo file installed on your 467Also, AREA/LOCATION must specify a timezone supported by your system,
468system, otherwise what timezone will be used depends on the underlying 468otherwise the behavior depends on the underlying OS and library."
469OS and library."
470 :type '(repeat (list string string)) 469 :type '(repeat (list string string))
471 :version "23.1") 470 :version "23.1")
472 471
473(defcustom legacy-style-world-list 472(defcustom legacy-style-world-list
474 '(("PST8PDT" "Seattle") 473 ;; This list is for circa 2025 timekeeping, and will need changes
475 ("EST5EDT" "New York") 474 ;; if any of these locations change names, time zones, or DST rules.
476 ("GMT0BST" "London") 475 (append
477 ("CET-1CDT" "Paris") 476 ;; These entries assume the platform's default DST rules are for the US,
478 ("IST-5:30" "Bangalore") 477 ;; which is true of all known platforms that use this variable.
479 ("JST-9" "Tokyo")) 478 '(("PST8PDT" "Seattle")
479 ("EST5EDT" "New York"))
480
481 ;; Use POSIX.1-2017 style TZ if supported; otherwise, give up on London
482 ;; and Paris as "GMT0BST" and "CET-1CDT" would use incorrect DST.
483 (when (string-equal (format-time-string "%z" 0 "XXX0YYY,M9.5.0/1,M4.1.0/3")
484 "+0100")
485 '(("GMT0BST,M3.5.0/1,M10.5.0" "London")
486 ("CET-1CEST,M3.5.0,M10.5.0/3" "Paris")))
487
488 '(("IST-5:30" "Delhi")
489 ("JST-9" "Tokyo")))
480 "Alist of traditional-style time zones and places for `world-clock'. 490 "Alist of traditional-style time zones and places for `world-clock'.
481Each element has the form (TIMEZONE LABEL). 491Each element has the form (TIMEZONE LABEL).
482TIMEZONE should be a string of the form: 492TIMEZONE should be a string of the form:
483 493
484 std[+|-]offset[dst[offset][,date[/time],date[/time]]] 494 std[+|-]offset[dst[[+|-]offset][,date[/time],date[/time]]]
485 495
486See the documentation of the TZ environment variable on your system, 496See the documentation of the TZ environment variable on your system,
487for more details about the format of TIMEZONE. 497for more details about the format of TIMEZONE.