Re: [PATCH] TODO: date range queries - check
authorJani Nikula <jani@nikula.org>
Fri, 7 Dec 2012 21:27:54 +0000 (23:27 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:43 +0000 (09:51 -0800)
eb/850a969a7e494c5eef7ec0d711f8b2c89dc19d [new file with mode: 0644]

diff --git a/eb/850a969a7e494c5eef7ec0d711f8b2c89dc19d b/eb/850a969a7e494c5eef7ec0d711f8b2c89dc19d
new file mode 100644 (file)
index 0000000..9f011a1
--- /dev/null
@@ -0,0 +1,124 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C9FF3431FAF\r
+       for <notmuch@notmuchmail.org>; Fri,  7 Dec 2012 13:28:02 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id KzG2ShTxIXqF for <notmuch@notmuchmail.org>;\r
+       Fri,  7 Dec 2012 13:28:02 -0800 (PST)\r
+Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
+       [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 138AB431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  7 Dec 2012 13:28:01 -0800 (PST)\r
+Received: by mail-lb0-f181.google.com with SMTP id ge1so774236lbb.26\r
+       for <notmuch@notmuchmail.org>; Fri, 07 Dec 2012 13:27:59 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type:x-gm-message-state;\r
+       bh=kO9rnLfsYOyuXtEPw2ChLbbCF8kYtPiugEfFnsVdf64=;\r
+       b=SAlBhkB+hwmS1PaH3fQqa39UvQ5/oIUc2wV9pB8jfw7ca/n+8ImZuulQOq6A40upOF\r
+       vRGLFCIyBnVvHJA4am9pzdldENzv+tKil04WgWzr+1jn9qdgC63WCHzZxjlZeAT1azTm\r
+       mlUZ7j0sGTjlhI4D/uF3B+jc4apjmiAZlNgstW/ZNwk9uLgnmdLNxLDJnJ2uyzf5Jrw1\r
+       IfJa8sz7WzA0TAnZDWNUmbxB2EtbDRVJgWaeEk/5TmjDc8GB1JFx0oHHCuXH3n61fnpv\r
+       jar/fihxdJ7Tq9C64z/KhAbgNSXAIca4StnjNUZbxNyMMY5CREXEpF8y8AdM8JjFv5NX\r
+       gwFA==\r
+Received: by 10.152.110.234 with SMTP id id10mr6755434lab.15.1354915677875;\r
+       Fri, 07 Dec 2012 13:27:57 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id b3sm5119886lbl.0.2012.12.07.13.27.55\r
+       (version=SSLv3 cipher=OTHER); Fri, 07 Dec 2012 13:27:56 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+       David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] TODO: date range queries - check\r
+In-Reply-To: <50C21EC8.6020504@fifthhorseman.net>\r
+References: <1354833276-6219-1-git-send-email-jani@nikula.org>\r
+       <877gouine4.fsf@servo.finestructure.net>\r
+       <871uf2ukat.fsf@zancas.localnet>\r
+       <50C21EC8.6020504@fifthhorseman.net>\r
+User-Agent: Notmuch/0.14+138~g7041c56 (http://notmuchmail.org) Emacs/23.4.1\r
+       (i686-pc-linux-gnu)\r
+Date: Fri, 07 Dec 2012 23:27:54 +0200\r
+Message-ID: <878v99zh5x.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQme9XWOBToTDK6wvEzxsrvCnWlVOuo5ykBBK33AdWXh2pLiupP8MLM3U2A3QgkIX4e8tvuF\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 07 Dec 2012 21:28:02 -0000\r
+\r
+On Fri, 07 Dec 2012, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:\r
+> On 12/07/2012 07:19 AM, David Bremner wrote:\r
+>> For specifying one-ended ranges, I find the current syntax OK-ish. It\r
+>> would be reasonable to formulate a seperate TODO for supporting\r
+>> things like date:2012-12-07\r
+>\r
+> Out of curiosity, how does this syntax interact with timezones?\r
+\r
+We don't have this particular syntax yet, but it would seem sensible to\r
+expand that to the range expression date:2012-12-07..2012-12-07, which\r
+is currently supported, and means all the messages from the beginning of\r
+specified date to the end.\r
+\r
+> If i send a mail in the wee hours of the 27th from the east coast of the\r
+> US (GMT-0500) and jrollins reads it from the west coast of the US\r
+> (GMT-0800) where it is still the 26th, should our notmuch queries behave\r
+> differently when searching for this message?\r
+\r
+I'll answer that question with another question: Do you think date\r
+queries should be interpreted according to the timezone of the sender or\r
+the recipient? I'm inclined to believe the local timezone of the system\r
+the query is run on (typically the recipient's timezone) is the only\r
+answer that makes sense, and my ever pessimist/realist gut feeling is\r
+that any attempts to be more clever about the difference in timezones\r
+than the user will be doomed. For you the message date is the 27th, and\r
+for jrollins it's the 26th. But read on.\r
+\r
+> are we tracking the TZ of the Date: header in the database at all?  does\r
+> it make sense to take that into account for these queries?\r
+\r
+We don't track it or take it into account. The Date: header is converted\r
+to a time_t value using g_mime_utils_header_decode_date(), and stored\r
+into the database as a timestamp. The date: queries are also converted\r
+to timestamps, using local timezone *unless* a timezone is specified in\r
+the query.\r
+\r
+And this is the interesting part: You can specify the timezone in the\r
+query. If jrollins talks about a message you sent him on the 26th, you\r
+can, as you know his timezone, query\r
+date:2012-12-26-0800..2012-12-26-0800 to get all messages on that day in\r
+*his* timezone. Including the one you sent him on *your* 27th.\r
+\r
+>      --dkg, posing questions he has no answers to\r
+\r
+At the end of the day, I don't have an answer as to whether or indeed\r
+how the sender's timezone could be taken into account in the\r
+queries. But I hope the above clears up how we handle dates and\r
+timezones now, and perhaps leads you to an answer I don't have!\r
+\r
+\r
+BR,\r
+Jani.\r