[racket] JSON datetime value?

From: Limbo Peng (iwinux at gmail.com)
Date: Sun Jan 6 04:37:30 EST 2013


On 01/05, Michael Wilber wrote:
> JSON doesn't specify a way of encoding dates. See http://json.org/
> You have to convert your date to a string first, like this:
> 
> racket> (jsexpr->string (date->string (current-date)))
> "\"Sat Jan 05 11:20:35-0700 2013\""

I'm checked both (racket/date)'s date->string and (srfi/19)'s - 
it's weird that the former does not allow custom datetime format,
and worse, (racket/date)'s date* struct cannot be converted to sql-timestamp.

Guess that I should stick with (srfi/19) and ignore (racket/date). Any suggestion?


Posted on the users mailing list.