couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Charette <>
Subject Re: map timezones
Date Thu, 07 Mar 2013 17:21:35 GMT
Kanso has the moment.js library as well so you can require it client and server side.

Jeff Charette | Principal 
We Are Charette
web / identity / packaging

m  415.298.2707

On Mar 7, 2013, at 12:24 AM, Will Heger <> wrote:

> @Jens
>> What’s “local time”? The time zone of the server? A map/reduce function
>> has to be a “pure” function, so it can’t depend on any external inputs
>> that might change, such as the current timezone.
> Well, this was very much my point.  I'm not interested in server locale or
> a Date() time, I'm interested in the absolute time stamped on my docs by
> clients.  I just want to use it in conjunction with location so my maps can
> report local time.
> We are missing the following library for our views:
> 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
> 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.
> Thanks for letting me rubber duck this, I hope this strategy helps someone
> else,
> -Will

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