--- /dev/null
+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 2518D431FBD\r
+ for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 14:23:03 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\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 KtUkBwgc6+iN for <notmuch@notmuchmail.org>;\r
+ Sun, 21 Oct 2012 14:23:01 -0700 (PDT)\r
+Received: from mail-la0-f53.google.com (mail-la0-f53.google.com\r
+ [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 29D69431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 14:23:01 -0700 (PDT)\r
+Received: by mail-la0-f53.google.com with SMTP id l5so1455559lah.26\r
+ for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 14:23:00 -0700 (PDT)\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:date:message-id:x-mailer:in-reply-to:references\r
+ :in-reply-to:references:x-gm-message-state;\r
+ bh=FU5wqKqkyR2So/wF3Gs/T+cnxMfYMmXboqend1CP+Y4=;\r
+ b=dNinTAE3sSws/fTnfjCT4gNI3MENBeGnHpJxbaVLBrAjH0MVVk55qlIvxW/5cQ7rKi\r
+ K0h4bs36X29zjv3R7/w8LzPQmGZ+zAu3C1jtoFtQsl4Q5XksfLTArtNNUZ4e5D62J/lB\r
+ Scwt4HxMo9JhQjifkSJH4GfzclRZaZ7iviK2MCg3sExIhlzPMlN1urncKra2Sy0bb7wH\r
+ 5bP6atg7V6lFqklnsLL1+J30U8uNv8VoBXjGqKplKT9Hi2lFiheekNAh42T93+Z/ngKi\r
+ o3HuzWOh3DUmI0zhrd6eQQtXljsrJlgmKRgCgfExbJ1s3qn3IPEmRzKk2dsdXi7hDNqj\r
+ JqMQ==\r
+Received: by 10.152.106.171 with SMTP id gv11mr6566408lab.26.1350854580781;\r
+ Sun, 21 Oct 2012 14:23:00 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
+ [80.223.81.27])\r
+ by mx.google.com with ESMTPS id f2sm1365814lbz.6.2012.10.21.14.22.59\r
+ (version=SSLv3 cipher=OTHER); Sun, 21 Oct 2012 14:22:59 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v5 8/9] man: document the date:since..until range queries\r
+Date: Mon, 22 Oct 2012 00:22:31 +0300\r
+Message-Id:\r
+ <cff9c1dd87b8bc11326dca0b3589c81656500f5e.1350854171.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1350854171.git.jani@nikula.org>\r
+References: <cover.1350854171.git.jani@nikula.org>\r
+In-Reply-To: <cover.1350854171.git.jani@nikula.org>\r
+References: <cover.1350854171.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQleNuvYCshIrocshvM/MT+0Fw/ooXUFLD2W657TbnwkpUvucfYokGa3vdNjz3MSgdWwbCif\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: Sun, 21 Oct 2012 21:23:03 -0000\r
+\r
+---\r
+ man/man7/notmuch-search-terms.7 | 147 +++++++++++++++++++++++++++++++++++----\r
+ 1 file changed, 135 insertions(+), 12 deletions(-)\r
+\r
+diff --git a/man/man7/notmuch-search-terms.7 b/man/man7/notmuch-search-terms.7\r
+index 17a109e..fbd3ee7 100644\r
+--- a/man/man7/notmuch-search-terms.7\r
++++ b/man/man7/notmuch-search-terms.7\r
+@@ -54,6 +54,8 @@ terms to match against specific portions of an email, (where\r
+ \r
+ folder:<directory-path>\r
+ \r
++ date:<since>..<until>\r
++\r
+ The\r
+ .B from:\r
+ prefix is used to match the name or address of the sender of an email\r
+@@ -104,6 +106,26 @@ contained within particular directories within the mail store. Only\r
+ the directory components below the top-level mail database path are\r
+ available to be searched.\r
+ \r
++The\r
++.B date:\r
++prefix can be used to restrict the results to only messages within a\r
++particular time range (based on the Date: header) with a range syntax\r
++of:\r
++\r
++ date:<since>..<until>\r
++\r
++See \fBDATE AND TIME SEARCH\fR below for details on the range\r
++expression, and supported syntax for <since> and <until> date and time\r
++expressions.\r
++\r
++The time range can also be specified using timestamps with a syntax\r
++of:\r
++\r
++ <initial-timestamp>..<final-timestamp>\r
++\r
++Each timestamp is a number representing the number of seconds since\r
++1970\-01\-01 00:00:00 UTC.\r
++\r
+ In addition to individual terms, multiple terms can be\r
+ combined with Boolean operators (\r
+ .BR and ", " or ", " not\r
+@@ -117,20 +139,121 @@ operators, but will have to be protected from interpretation by the\r
+ shell, (such as by putting quotation marks around any parenthesized\r
+ expression).\r
+ \r
+-Finally, results can be restricted to only messages within a\r
+-particular time range, (based on the Date: header) with a syntax of:\r
++.SH DATE AND TIME SEARCH\r
+ \r
+- <initial-timestamp>..<final-timestamp>\r
++This is a non-exhaustive description of the date and time search with\r
++some pseudo notation. Most of the constructs can be mixed freely, and\r
++in any order, but the same absolute date or time can't be expressed\r
++twice.\r
+ \r
+-Each timestamp is a number representing the number of seconds since\r
+-1970\-01\-01 00:00:00 UTC. This is not the most convenient means of\r
+-expressing date ranges, but until notmuch is fixed to accept a more\r
+-convenient form, one can use the date program to construct\r
+-timestamps. For example, with the bash shell the following syntax would\r
+-specify a date range to return messages from 2009\-10\-01 until the\r
+-current time:\r
+-\r
+- $(date +%s \-d 2009\-10\-01)..$(date +%s)\r
++.RS 4\r
++.TP 4\r
++.B The range expression\r
++\r
++date:<since>..<until>\r
++\r
++The above expression restricts the results to only messages from\r
++<since> to <until>, based on the Date: header.\r
++\r
++If <since> or <until> describes time at an accuracy of days or less,\r
++the date/time is rounded, towards past for <since> and towards future\r
++for <until>, to be inclusive. For example, date:january..february\r
++matches from the beginning of January until the end of\r
++February. Similarly, date:yesterday..yesterday matches from the\r
++beginning of yesterday until the end of yesterday.\r
++\r
++Open-ended ranges are supported (since Xapian 1.2.1), i.e. it's\r
++possible to specify date:..<until> or date:<since>.. to not limit the\r
++start or end time, respectively. Unfortunately, pre-1.2.1 Xapian does\r
++not report an error on open ended ranges, but it does not work as\r
++expected either.\r
++\r
++Xapian does not support spaces in range expressions. You can replace\r
++the spaces with '_', or (in most cases) '-', or (in some cases) leave\r
++the spaces out altogether.\r
++\r
++Entering date:expr without ".." (for example date:yesterday) won't\r
++work, as it's not interpreted as a range expression at all. You can\r
++achieve the expected result by duplicating the expr both sides of ".."\r
++(for example date:yesterday..yesterday).\r
++.RE\r
++\r
++.RS 4\r
++.TP 4\r
++.B Relative date and time\r
++[N|number] (years|months|weeks|days|hours|hrs|minutes|mins|seconds|secs) [...]\r
++\r
++All refer to past, can be repeated and will be accumulated.\r
++\r
++Units can be abbreviated to any length, with the otherwise ambiguous\r
++single m being m for minutes and M for months.\r
++\r
++Number multiplier can also be written out one, two, ..., ten, dozen,\r
++hundred. As special cases last means one ("last week") and this means\r
++zero ("this month").\r
++\r
++When combined with absolute date and time, the relative date and time\r
++specification will be relative from the specified absolute date and\r
++time.\r
++\r
++Examples: 5M2d, two weeks\r
++.RE\r
++\r
++.RS 4\r
++.TP 4\r
++.B Supported time formats\r
++H[H]:MM[:SS] [(am|a.m.|pm|p.m.)]\r
++\r
++H[H] (am|a.m.|pm|p.m.)\r
++\r
++HHMMSS\r
++\r
++now\r
++\r
++noon\r
++\r
++midnight\r
++\r
++Examples: 17:05, 5pm\r
++.RE\r
++\r
++.RS 4\r
++.TP 4\r
++.B Supported date formats\r
++YYYY-MM[-DD]\r
++\r
++DD-MM[-[YY]YY]\r
++\r
++MM-YYYY\r
++\r
++M[M]/D[D][/[YY]YY]\r
++\r
++M[M]/YYYY\r
++\r
++D[D].M[M][.[YY]YY]\r
++\r
++D[D][(st|nd|rd|th)] Mon[thname] [YYYY]\r
++\r
++Mon[thname] D[D][(st|nd|rd|th)] [YYYY]\r
++\r
++Wee[kday]\r
++\r
++Month names can be abbreviated at three or more characters.\r
++\r
++Weekday names can be abbreviated at three or more characters.\r
++\r
++Examples: 2012-07-31, 31-07-2012, 7/31/2012, August 3\r
++.RE\r
++\r
++.RS 4\r
++.TP 4\r
++.B Time zones\r
++(+|-)HH:MM\r
++\r
++(+|-)HH[MM]\r
++\r
++Some time zone codes, e.g. UTC, EET.\r
++.RE\r
+ \r
+ .SH SEE ALSO\r
+ \r
+-- \r
+1.7.10.4\r
+\r