changeset 85803:05d1905f2a7a

(display-time-world-list): Test for zoneinfo support.
author Jason Rumney <jasonr@gnu.org>
date Tue, 30 Oct 2007 21:24:57 +0000
parents a69014d11d95
children b9d04b479b22
files lisp/time.el
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/time.el	Tue Oct 30 20:27:22 2007 +0000
+++ b/lisp/time.el	Tue Oct 30 21:24:57 2007 +0000
@@ -150,9 +150,17 @@
   :version "23.1")
 
 (defcustom display-time-world-list
-  (if (memq 'system-type '(gnu/linux ms-dos))
-      zoneinfo-style-world-list
-    legacy-style-world-list)
+  ;; Determine if zoneinfo style timezones are supported by testing that
+  ;; America/New York and Europe/London return different timezones.
+  (let (gmt nyt)
+    (set-time-zone-rule "America/New York")
+    (setq nyt (format-time-string "%z"))
+    (set-time-zone-rule "Europe/London")
+    (setq gmt (format-time-string "%z"))
+    (set-time-zone-rule nil)
+    (if (string-equal nyt gmt)
+        legacy-style-world-list
+      zoneinfo-style-world-list))
   "Alist of time zones and places for `display-time-world' to display.
 Each element has the form (TIMEZONE LABEL).
 TIMEZONE should be in the format supported by `set-time-zone-rule' on