2
我想出了在看文檔最接近的事是如何將SQL-timestamp轉換爲球拍中的字符串?
(define (sql-datetime->rfc2822 datetime)
(let ([dt (sql-datetime->srfi-date datetime)])
(date->string dt (date-display-format 'rfc2822))))
但是,當我將它傳遞失敗一個sql-timestamp
> (sql-datetime->rfc2822 st)
. . date->string: contract violation
expected: date?
given: (tm:date 456232000 10 39 18 5 5 2013 0)
in: the 1st argument of
(->* (date?) (any/c) string?)
contract from: <collects>/racket/date.rkt