diff options
| author | Jim Blandy | 1993-03-18 21:39:28 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-03-18 21:39:28 +0000 |
| commit | 0267e275bc879ec20cc1a0765a08848a5bf8ac40 (patch) | |
| tree | 6a1002a6232aa329dcac23689048745fc99dd6bc | |
| parent | e9571d2a21b7fd2dc46549382bea5ed4c00ddb07 (diff) | |
| download | emacs-0267e275bc879ec20cc1a0765a08848a5bf8ac40.tar.gz emacs-0267e275bc879ec20cc1a0765a08848a5bf8ac40.zip | |
* solar.el (solar-time-string): Round the time properly.
| -rw-r--r-- | lisp/calendar/solar.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index 84b9dfe6ffb..041dda5c88a 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el | |||
| @@ -244,11 +244,14 @@ savings time according to `calendar-daylight-savings-starts' and | |||
| 244 | calendar-daylight-time-zone-name | 244 | calendar-daylight-time-zone-name |
| 245 | calendar-standard-time-zone-name)) | 245 | calendar-standard-time-zone-name)) |
| 246 | (24-hours (truncate time)) | 246 | (24-hours (truncate time)) |
| 247 | (minutes (round (* 60 (- time 24-hours)))) | ||
| 248 | (24-hours (if (= minutes 60) (1+ 24-hours) 24-hours)) | ||
| 249 | (minutes (if (= minutes 60) 0 minutes)) | ||
| 250 | (minutes (format "%02d" minutes)) | ||
| 247 | (12-hours (format "%d" (if (> 24-hours 12) | 251 | (12-hours (format "%d" (if (> 24-hours 12) |
| 248 | (- 24-hours 12) | 252 | (- 24-hours 12) |
| 249 | (if (= 24-hours 0) 12 24-hours)))) | 253 | (if (= 24-hours 0) 12 24-hours)))) |
| 250 | (am-pm (if (>= 24-hours 12) "pm" "am")) | 254 | (am-pm (if (>= 24-hours 12) "pm" "am")) |
| 251 | (minutes (format "%02d" (round (* 60 (- time 24-hours))))) | ||
| 252 | (24-hours (format "%02d" 24-hours))) | 255 | (24-hours (format "%02d" 24-hours))) |
| 253 | (mapconcat 'eval calendar-time-display-form ""))) | 256 | (mapconcat 'eval calendar-time-display-form ""))) |
| 254 | 257 | ||