summaryrefslogtreecommitdiff
path: root/lisp/calendar/cal-dst.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-08-09 12:34:23 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-08-09 12:34:23 +0200
commit3c728d4c69f2abe991ef84787ae1014ad1cd29d2 (patch)
tree142e94a83742239713e5b940eb7a50af324efd8f /lisp/calendar/cal-dst.el
parentf3e0da29a248a2dc7dd7d640f8280b10bfc288f9 (diff)
downloademacs-3c728d4c69f2abe991ef84787ae1014ad1cd29d2.tar.gz
Add a variable to allow displaying numeric time zones
* lisp/calendar/calendar.el (calendar-use-numeric-time-zones): New variable. * doc/emacs/calendar.texi (Sunrise/Sunset): Document it (bug#33149). * lisp/calendar/cal-dst.el (calendar-standard-time-zone-name): Use it. (calendar-daylight-time-zone-name): Ditto. * lisp/calendar/solar.el (sunrise-sunset): Adjust usage. (solar-equinoxes-solstices): Ditto.
Diffstat (limited to 'lisp/calendar/cal-dst.el')
-rw-r--r--lisp/calendar/cal-dst.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 3db12e668ab..af6acaf09ad 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -350,17 +350,29 @@ If the locale never uses daylight saving time, set this to 0."
:group 'calendar-dst)
(defcustom calendar-standard-time-zone-name
- (or (nth 2 calendar-current-time-zone-cache) "EST")
+ (if calendar-use-numeric-time-zones
+ (if calendar-current-time-zone-cache
+ (format-time-string
+ "%z" 0 (* 60 (car calendar-current-time-zone-cache)))
+ "+0000")
+ (or (nth 2 calendar-current-time-zone-cache) "EST"))
"Abbreviated name of standard time zone at `calendar-location-name'.
For example, \"EST\" in New York City, \"PST\" for Los Angeles."
:type 'string
+ :version "28.1"
:group 'calendar-dst)
(defcustom calendar-daylight-time-zone-name
- (or (nth 3 calendar-current-time-zone-cache) "EDT")
+ (if calendar-use-numeric-time-zones
+ (if calendar-current-time-zone-cache
+ (format-time-string
+ "%z" 0 (* 60 (cadr calendar-current-time-zone-cache)))
+ "+0000")
+ (or (nth 3 calendar-current-time-zone-cache) "EDT"))
"Abbreviated name of daylight saving time zone at `calendar-location-name'.
For example, \"EDT\" in New York City, \"PDT\" for Los Angeles."
:type 'string
+ :version "28.1"
:group 'calendar-dst)
(defcustom calendar-daylight-savings-starts-time