Adding current-date
This commit is contained in:
parent
991e2a4064
commit
009ae0588e
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user