* lisp/calendar/time-date.el (time-zone-format): New function.
filled out), and 'encoded-time-set-defaults' (which fills in nil
elements as if it's midnight January 1st, 1970) have been added.
+*** The new function `time-zone-format' has been added to format
+Emacs time zones (which are in seconds) according to many standards
+(i.e., "+01:00").
+
** 'define-minor-mode' automatically documents the meaning of ARG.
+++
(<= (car here) delay)))
(concat (format "%.2f" (/ delay (car (cddr here)))) (cadr here))))))
+(defun time-zone-format (seconds)
+ "Format SECONDS as a valid time zone string.
+For instance, 3600 is \"+01:00\"."
+ (format "%s%02d:%02d"
+ (if (< seconds 0)
+ "-"
+ "+")
+ (/ (abs seconds) 3600)
+ (mod (abs seconds) 3600)))
+
(defun date-days-in-month (year month)
"The number of days in MONTH in YEAR."
(if (= month 2)
(should (equal (decoded-time-add time (mdec :zone -7200))
'(12 15 14 8 7 2019 1 t 7200)))))
+(ert-deftest test-time-zone-format ()
+ (should (equal (time-zone-format 3600)
+ "+01:00"))
+ (should (equal (time-zone-format -7200)
+ "-02:00")))
+
(require 'ert)
;;; time-date-tests.el ends here