From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 51E4F1F9FE for ; Thu, 11 Mar 2021 10:45:38 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/7] doc: glossary: add information for dates and timestamps Date: Thu, 11 Mar 2021 02:45:32 -0800 Message-Id: <20210311104538.7743-2-e@80x24.org> In-Reply-To: <20210311104538.7743-1-e@80x24.org> References: <20210311104538.7743-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: These have been confusing to me in the past, too. --- Documentation/public-inbox-glossary.pod | 14 ++++++++++++++ lib/PublicInbox/Search.pm | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Documentation/public-inbox-glossary.pod b/Documentation/public-inbox-glossary.pod index e188e563..61e1e9f8 100644 --- a/Documentation/public-inbox-glossary.pod +++ b/Documentation/public-inbox-glossary.pod @@ -83,6 +83,20 @@ the same email into one or more virtual folders for ease-of-filtering. This is NOT tied to public-inbox names, as messages stored by lei may not be public. +=item IMAP INTERNALDATE, JMAP receivedAt, rt: search prefix + +The first valid timestamp value of Received: headers (top first). +If no Received: header exists, the Date: header is used, and the +current time if neither header(s) exist. When mirroring via +git, this is the git commit time. + +=item IMAP SENT*, JMAP sentAt, dt: and d: search prefixes + +The first valid timestamp value of the Date: header(s). +If no Date: header exists, the time from the Received: header is +used, and then the current time if neither header exists. +When mirroring via git, this is the git author time. + =head1 COPYRIGHT Copyright 2021 all contributors L diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 209969c5..c7d52daf 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -13,9 +13,9 @@ use POSIX qw(strftime); # values for searching, changing the numeric value breaks # compatibility with old indices (so don't change them it) use constant { - TS => 0, # Received: header in Unix time (IMAP INTERNALDATE) + TS => 0, # Received: in Unix time (IMAP INTERNALDATE, JMAP receivedAt) YYYYMMDD => 1, # Date: header for searching in the WWW UI - DT => 2, # Date: YYYYMMDDHHMMSS + DT => 2, # Date: YYYYMMDDHHMMSS (IMAP SENT*, JMAP sentAt) # added for public-inbox 1.6.0+ BYTES => 3, # IMAP RFC822.SIZE