On this page:
top
up

SRFI 19: Time Data Types and ProceduresπŸ”— i

Original specification: SRFI 19

The date structure produced by this SRFI library is identical to the one provided by racket/base in most cases (see date ).

For backwards compatibility, when an invalid date field value is provided to the SRFI constructor, the constructor will produce a lax date structure. A lax date structure is not compatible with functions from racket/base or racket/date. SRFI functions such as string->date may return a lax date structure depending on the format string. The predicate lax-date? recognizes lax dat structures.

As an extension, Racket’s implementation of string->date supports ~? as a conversion specifier: it parses one- and two-digit years like ~y and three- and four-digit years like ~Y.

Examples:
> (string->date "4-1-99""~d-~m-~?")

(date* 0 0 0 4 1 1999 1 3 #f 0 0 "")

> (string->date "4-1-1999""~d-~m-~?")

(date* 0 0 0 4 1 1999 1 3 #f 0 0 "")

procedure

( lax-date? v)boolean?

v:any/c
Returns #t if v is a lax date structure. Otherwise, returns #f.

Examples:
> (lax-date? (make-date 019101014"bogus""bogus"0))

#t

> (lax-date? (make-date 019101014120130))

#f

> (lax-date? (string->date "10:21:00""~H:~M:~S"))

#t

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /