From user-return-16993-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Jul 6 14:54:21 2011 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C7386828 for ; Wed, 6 Jul 2011 14:54:21 +0000 (UTC) Received: (qmail 76495 invoked by uid 500); 6 Jul 2011 14:54:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 76438 invoked by uid 500); 6 Jul 2011 14:54:18 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 76430 invoked by uid 99); 6 Jul 2011 14:54:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 14:54:18 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of juanjo@comellas.org does not designate 209.85.161.44 as permitted sender) Received: from [209.85.161.44] (HELO mail-fx0-f44.google.com) (209.85.161.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 14:54:13 +0000 Received: by fxe6 with SMTP id 6so168639fxe.31 for ; Wed, 06 Jul 2011 07:53:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.24.17 with SMTP id t17mr13154453fab.143.1309964031319; Wed, 06 Jul 2011 07:53:51 -0700 (PDT) Received: by 10.223.114.5 with HTTP; Wed, 6 Jul 2011 07:53:51 -0700 (PDT) In-Reply-To: References: Date: Wed, 6 Jul 2011 11:53:51 -0300 Message-ID: Subject: Re: json date representations From: Juan Jose Comellas To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001517440f24c15ffd04a767c449 --001517440f24c15ffd04a767c449 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable We use CouchDB for a telephony application where we sometimes need subsecon= d precision, so we store timestamps as floating point numbers, where the integer part corresponds to the seconds and the decimal part to the {milli,micro,nano}seconds since the Unix epoch (Jan 1, 1970). The nice thin= g about this format is that it can be used both for absolute (a date) and relative (the offset at which an event occurred) timestamps and you can easily perform arithmetic operations between them. 2011/7/5 Rudi Benkovi=C4=8D > Hi, > > I'm writing a little CouchDB administration utility and would like to > find out how most of you store data values in JSON. From .NET via > Newtonsoft's JSON serializer, dates end up in the ISO 8601 as a > string, like this: > > { Timestamp": "2011-05-12T20:52:02.3774261Z" } > > Let me know what other formats are used, as I'd like to cover as much > of them as possible - hopefully the Javascript view code will be able > to detect them automatically. > > Thanks! > > Rudi > --001517440f24c15ffd04a767c449--