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 CBAA210479 for ; Wed, 8 Jan 2014 14:53:49 +0000 (UTC) Received: (qmail 72948 invoked by uid 500); 8 Jan 2014 14:45:29 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 72833 invoked by uid 500); 8 Jan 2014 14:45: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 72744 invoked by uid 99); 8 Jan 2014 14:45:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 14:45:07 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [74.125.83.46] (HELO mail-ee0-f46.google.com) (74.125.83.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 14:44:59 +0000 Received: by mail-ee0-f46.google.com with SMTP id d49so724101eek.33 for ; Wed, 08 Jan 2014 06:44:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=Ob5YV6rWjqpRZNvZi8Efk2RGT1EqD+1x3b/0aDOG5zY=; b=CFoGfcEWT+rNq95NLRX33+E1qOD3fwQQKuDD/yePVmUD4HIjYh8JBDYvkCwMLHHfLE RpsntJwQUcc3PnC3eBCQ6n3S67od1w8CkO79j2EqPyVvyddPOLEd51jkins2hi+geRYm bzEzsmk0kJ/NYVszOoVIgPOzNPv96TfdtB6D018fRTEC20Q+Ay5tNC8JG4E6KA601Jbz WpctGhMu8nWtA17mh5sHYW0tMfeE8lyNKCh0eFnDkNhMrf59a2BnpZLLbOvavkzaVjG3 FAitgiocoX2jRPPPH7NnBrIuxTUDCla096MPZ7xhaXfPwqK3cD+Quv4VgCnbbPZKg1cj jj8A== X-Gm-Message-State: ALoCoQn2NgRXU98sHjwb3+OSHu+oUfK3r6zat3D+yz08PKiemIYyJAe2nUeh3xH+cY4R4J5Bs3pZ X-Received: by 10.15.24.142 with SMTP id j14mr46874138eeu.52.1389192279304; Wed, 08 Jan 2014 06:44:39 -0800 (PST) Received: from [192.168.2.112] ([77.72.35.178]) by mx.google.com with ESMTPSA id p45sm189910630eeg.1.2014.01.08.06.44.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 06:44:38 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: CouchDB: Timestamp inaccurate and seems to be cached From: Filippo Fadda In-Reply-To: Date: Wed, 8 Jan 2014 15:44:37 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1283) X-Virus-Checked: Checked by ClamAV on apache.org I suggest to generate the timestamp when you save the document, not when = you index it. -Filippo On Jan 8, 2014, at 3:17 PM, Hank Knight wrote: > I use this Map Function to get the current Unix timestamp: >=20 > function(doc) {emit(Math.round(new Date().getTime()/1000), null );} >=20 > The odd thing is, it returns a correct timestamp the first time I run > a query but it returns the exact same timestamp one minute later even > though 60 seconds have passed! Is this due to caching or something > else? What is the best way for me to always get the current Unix > timestamp?