Getting Picky About Date Searches

[return-to: Finding Messages with pick] [table of contents] [index]

If you need to be precise, here's something useful that isn't in the standard pick(1) manual page.

With date specifications like yesterday, monday, or -2 ("two days ago"), pick actually counts hours, not days. Each day is counted as 24 hours in the past. This 24 hours even includes time zones.

For instance, pick -before -1 would search for messages sent more than 24 hours ago. If it's 9:30 a.m. on January 17 now, that command would find messages sent before 9:30 a.m. on January 16 -- but not messages sent after 9:30 a.m. on the 16th. The command pick -after yesterday would find messages sent after 9:30 a.m. on January 16 (after 24 hours ago).

If the message is from someone in another time zone, pick counts that, too. If it's 9:30 a.m. EST (U.S. Eastern Standard Time) on January 17 now, the command pick -before -1 would find messages sent before 9:30 a.m. EST on January 16 -- also messages sent before 8:30 a.m. CST (Central), 7:30 a.m. MST (Mountain), and 6:30 a.m. PST (Pacific). Whew.

For a cutoff at midnight on a certain day, ignoring the time zone, you have to use the date, month, and year format. For instance, if it's now 9:30 a.m. on January 17, 1995, you could find messages sent any time before midnight yesterday with pick -before 16-jan-95 (this would find a message sent at 11:59 p.m. on January 15, but not a message sent any time on January 16 or 17).

[Table of Contents] [Index] [Return to: Finding Messages with pick]


Last change $Date: 1996/06/06 15:10:30 $

This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.

Suggestions are welcome: Jerry Peek <jpeek@jpeek.com>