incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rudi Benkovic <ru...@whiletrue.com>
Subject Re: json date representations
Date Wed, 06 Jul 2011 10:30:07 GMT
Hello Max,

Wednesday, July 6, 2011, 2:23:12 AM, you wrote:

> ISO8601 is the preferred format because it sorts lexicographically, which
> makes it super easy to sort views by date. The JSON.stringify method in
> json2.js automatically converts javascript date objects to ISO8601 and
Ecmascript >> 1.4 (iirc) natively supports parsing ISO8601

> tl;dr always use ISO8601

Some alternatives that are produced by the Newtonsoft JSON serializer:

1) "LogDate":"\/Date(1234656000000)\/"
2) "LogDate":new Date(1234656000000)
3) "LogDate":"2009-02-15T00:00:00Z"

Unfortunately, 1) is actually the default unless ISO serialization is
explicitly specified, as in 3). Hence, my little survey about what other weird
formats might be out there. :)

-- 
Best regards,
 Rudi                            mailto:rudib@whiletrue.com


Mime
View raw message