emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 14c0a63 04/12: Make time-zone-format take a SHORT p


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 14c0a63 04/12: Make time-zone-format take a SHORT parameter
Date: Wed, 31 Jul 2019 15:47:58 -0400 (EDT)

branch: master
commit 14c0a63e79ebb5c7445b3a4d2fe6e98e4a707765
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Make time-zone-format take a SHORT parameter
    
    * lisp/calendar/time-date.el (time-zone-format): Accept an
    optional SHORT parameter.
---
 lisp/calendar/time-date.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index efc9ae4..6f85171 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -352,14 +352,18 @@ is output until the first non-zero unit is encountered."
                          (<= (car here) delay)))
              (concat (format "%.2f" (/ delay (car (cddr here)))) (cadr 
here))))))
 
-(defun time-zone-format (seconds)
+(defun time-zone-format (seconds &optional short)
   "Format SECONDS as a valid time zone string.
-For instance, 3600 is \"+01:00\"."
-  (format "%s%02d:%02d"
+For instance, 3600 is \"+01:00\".
+If SHORT, the colon isn't included."
+  (format "%s%02d%s%02d"
           (if (< seconds 0)
               "-"
             "+")
           (/ (abs seconds) 3600)
+          (if short
+              ""
+            ":")
           (mod (abs seconds) 3600)))
 
 (defun date-days-in-month (year month)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]