Adding current-date

This commit is contained in:
Jay McCarthy 2010-05-24 14:00:08 -06:00
parent 991e2a4064
commit 009ae0588e
2 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,7 @@
racket/contract)
(provide/contract
[current-date (-> date?)]
[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)
@ -19,6 +20,9 @@
[date->julian/scalinger (date? . -> . exact-integer?)]
[julian/scalinger->string (exact-integer? . -> . string?)])
(define (current-date)
(seconds->date (current-seconds)))
;; Support for Julian calendar added by Shriram;
;; current version only works until 2099 CE Gregorian

View File

@ -125,6 +125,10 @@ result is the result of @racket[expr].}
@note-lib-only[racket/date]
@defproc[(current-date) date?]{
An abbreviation for @racket[(seconds->date (current-seconds))].}
@defproc[(date->string [date date?] [time? any/c #f]) string?]{
Converts a date to a string. The returned string contains the time of