[racket] JSON datetime value?

From: Limbo Peng (iwinux at gmail.com)
Date: Sat Jan 5 12:55:45 EST 2013


Hi,

I want to convert some datetime values to JSON, but the json library
doesn't seem to support it:

    (require srfi/19)
    (require json)
    (jsexpr->string (current-date))
    ; it complains:
    ;; write-json: expected argument of type <bad JSON value>
    ;; given: (tm:date 561000000 33 12 1 6 1 2013 28800)

What would be the appropriate way to do it?
BTW: should I use library "srfi/19" or "date" when dealing with datetime?

Thanks in advance.

-Limbo Peng


Posted on the users mailing list.