diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-31 15:15:47 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-31 21:47:29 +0200 |
commit | fa648a59c9818ae284209ac7ae4f3700aebd92c9 (patch) | |
tree | 1fbb93253b803146e0fa13dddf3af00fb0c7db40 /lisp/calendar | |
parent | 4dcb692de0cf0107149abe501663a1477571bfc0 (diff) | |
download | emacs-fa648a59c9818ae284209ac7ae4f3700aebd92c9.tar.gz |
Allow timezone defaults in decoded-time-set-defaults
* lisp/calendar/time-date.el (decoded-time-set-defaults): Allow
passing in a default time zone, as this seems to be something
callers seem to do.
Diffstat (limited to 'lisp/calendar')
-rw-r--r-- | lisp/calendar/time-date.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index dfe8dce68b1..b94bf52760d 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -512,7 +512,7 @@ changes in daylight saving time are not taken into account." "Return a `decoded-time' structure with only the keywords given filled out." (list second minute hour day month year nil dst zone)) -(defun decoded-time-set-defaults (time) +(defun decoded-time-set-defaults (time &optional default-zone) "Set any nil values in `decoded-time' TIME to default values. The default value is based on January 1st, 1970 at midnight. @@ -536,6 +536,10 @@ TIME is modified and returned." (when (and (not (decoded-time-zone time)) (not (decoded-time-dst time))) (setf (decoded-time-dst time) -1)) + + (when (and (not (decoded-time-zone time)) + default-zone) + (setf (decoded-time-zone time) 0)) time) (provide 'time-date) |