Adding date->seconds
original commit: 1b6b721aee3bd26c9fcb2cf985815f584e2b20a0
This commit is contained in:
parent
4d0091213c
commit
12a888f33d
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
[current-date (-> date?)]
|
[current-date (-> date?)]
|
||||||
|
[date->seconds (date? . -> . exact-integer?)]
|
||||||
[date->string ((date?) (boolean?) . ->* . string?)]
|
[date->string ((date?) (boolean?) . ->* . string?)]
|
||||||
[date-display-format (parameter/c (symbols 'american 'chinese 'german 'indian 'irish 'julian 'iso-8601 'rfc2822))]
|
[date-display-format (parameter/c (symbols 'american 'chinese 'german 'indian 'irish 'julian 'iso-8601 'rfc2822))]
|
||||||
[find-seconds ((integer-in 0 61)
|
[find-seconds ((integer-in 0 61)
|
||||||
|
@ -251,6 +252,15 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(force d))))
|
(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 (find-seconds sec min hour day month year)
|
||||||
(define (signal-error msg)
|
(define (signal-error msg)
|
||||||
(error 'find-secs (string-append
|
(error 'find-secs (string-append
|
||||||
|
|
Loading…
Reference in New Issue
Block a user