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