couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark J. Reed" <markjr...@gmail.com>
Subject Re: json date representations
Date Wed, 06 Jul 2011 23:27:55 GMT
On Wed, Jul 6, 2011 at 3:44 PM, Randall Leeds <randall.leeds@gmail.com>wrote:

> On Wed, Jul 6, 2011 at 12:08, Mark J. Reed <markjreed@gmail.com> wrote:
> > On Wed, Jul 6, 2011 at 2:12 PM, Mark Hahn <mark@boutiquing.com> wrote:
> >
> >> Who decided months should be zero-based but not days?
> >>
> >
> > Not sure who the author was, but the motivation is that the month (and
> > weekday) number is expected to be used to index into an array of names,
> and
> > arrays are 0-based.  The day of the month is not an index into a list, so
> it
> > survives unmolested.
>
> Not true in a lot of languages (notably here: Erlang).
>

True, but not really relevant, as calendar:local_time/0 also returns months
numbered from 1. :)

Sorry for taking this thread off-track; I started off discussing the
limitations of JSON and the various choices in representing dates, and how
it would in many cases be more convenient, when deserializing into
JavaScript, to take advantage of JavaScript syntax not normally allowed in
JSON for creating actual Date objects.  Which led to a tangent about the
options for constructing such objects in JavaScript still not being terribly
easy to read for humans...

-- 
Mark J. Reed <markjreed@gmail.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message