changeset 2248:f45b07fa4e57

* solar.el (solar-time-string): Round the time properly.
author Jim Blandy <jimb@redhat.com>
date Thu, 18 Mar 1993 21:39:28 +0000
parents 2c7997f249eb
children 94fc2ce49c55
files lisp/calendar/solar.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/solar.el	Thu Mar 18 21:29:42 1993 +0000
+++ b/lisp/calendar/solar.el	Thu Mar 18 21:39:28 1993 +0000
@@ -244,11 +244,14 @@
 			calendar-daylight-time-zone-name
 			calendar-standard-time-zone-name))
 	 (24-hours (truncate time))
+	 (minutes (round (* 60 (- time 24-hours))))
+         (24-hours (if (= minutes 60) (1+ 24-hours) 24-hours))
+         (minutes (if (= minutes 60) 0 minutes))
+         (minutes (format "%02d" minutes))
 	 (12-hours (format "%d" (if (> 24-hours 12)
 				    (- 24-hours 12)
 				  (if (= 24-hours 0) 12 24-hours))))
 	 (am-pm (if (>= 24-hours 12) "pm" "am"))
-	 (minutes (format "%02d" (round (* 60 (- time 24-hours)))))
 	 (24-hours (format "%02d" 24-hours)))
     (mapconcat 'eval calendar-time-display-form "")))