From 12a888f33dce64ee8200c90da6229a16e0aba25d Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Mon, 24 May 2010 14:23:07 -0600 Subject: [PATCH] Adding date->seconds original commit: 1b6b721aee3bd26c9fcb2cf985815f584e2b20a0 --- collects/mzlib/date.rkt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/collects/mzlib/date.rkt b/collects/mzlib/date.rkt index 597815e..4767898 100644 --- a/collects/mzlib/date.rkt +++ b/collects/mzlib/date.rkt @@ -7,6 +7,7 @@ (provide/contract [current-date (-> date?)] + [date->seconds (date? . -> . exact-integer?)] [date->string ((date?) (boolean?) . ->* . string?)] [date-display-format (parameter/c (symbols 'american 'chinese 'german 'indian 'irish 'julian 'iso-8601 'rfc2822))] [find-seconds ((integer-in 0 61) @@ -251,6 +252,15 @@ (lambda () (force d)))) +(define (date->seconds date) + (find-seconds + (date-second date) + (date-minute date) + (date-hour date) + (date-day date) + (date-month date) + (date-year date))) + (define (find-seconds sec min hour day month year) (define (signal-error msg) (error 'find-secs (string-append