couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: map timezones
Date Fri, 08 Mar 2013 01:30:28 GMT

On Mar 6, 2013, at 9:24 PM, Will Heger <> wrote:

> In that way, as a developer I can store times within my document using
> either UTC or epoch times.  These times could be current or historical, it
> doesn't matter.  What matters is that they're unambiguous. And there exists
> a pure function F such that:
> F(doc.epoch_time, doc.location) = A time for that locale for that moment
> in history

I imagine that’s likely to be a fairly _slow_ function, though, which makes it a bad choice
to call inside map/reduce. People have already found their view performance being bottlenecked
by simpler tasks like basic date parsing.

> Absent this, I think the best idea is to store the epoch time and force the
> client to also stamp the relevant local UTC offset.  It offers the most
> flexibility in terms of reporting, deals with DST weirdness, and I have
> more resources to look-up UTC offsets from client code than in couch.

The standard date/time format already supports this, since it gives the time in UTC and appends
the numeric offset for local time. (E.g. “23:53:30-0800”.)

View raw message