From a658779710cf02200c4a1972d23a73be21f23c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 9 Nov 2019 13:59:55 +0100 Subject: Fii normalize-date* from previous commit. --- module/srfi/srfi-19/util.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/srfi') diff --git a/module/srfi/srfi-19/util.scm b/module/srfi/srfi-19/util.scm index ff23dbb9..67d407f8 100644 --- a/module/srfi/srfi-19/util.scm +++ b/module/srfi/srfi-19/util.scm @@ -108,11 +108,10 @@ attribute set to 0. Can also be seen as \"Start of day\"" ;; hack to handle leap seconds. NOTE this should be reworked. (define-public (normalize-date* date) (define next-date - (date-second - (time-utc->date - (add-duration (date->time-utc date) - (make-time time-duration 0 10))) - (set next-date 0)))) + (time-utc->date + (add-duration (date->time-utc date) + (make-time time-duration 0 10)))) + (set (date-second next-date) 0)) ;; Returns a stream of date objects, one day appart, staring from start-day. (define-public (day-stream start-day) -- cgit v1.2.3