From 95eeec937c7466987cd53e39207d4fff41fc0332 Mon Sep 17 00:00:00 2001 From: discopatrick Date: Thu, 1 Jun 2017 13:11:40 +0100 Subject: [PATCH] Add docs for datetime queries --- docs/reference/query.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/reference/query.rst b/docs/reference/query.rst index b4789aa10..70988f026 100644 --- a/docs/reference/query.rst +++ b/docs/reference/query.rst @@ -188,6 +188,33 @@ Find all items with a file modification time between 2008-12-01 and $ beet ls 'mtime:2008-12-01..2008-12-02' +You can also add an optional time value to date queries, specifying hours, +minutes, and seconds. + +Times are separated from dates by a space, an uppercase 'T' or a lowercase +'t', for example: ``2008-12-01T23:59:59``. If you specify a time, then the +date must contain a year, month, and day. The minutes and seconds are +optional. + +Here is an example that finds all items added on 2008-12-01 at or after 22:00 +but before 23:00:: + + $ beet ls 'added:2008-12-01T22' + +Find all items added on or after 2008-12-01 22:45:: + + $ beet ls 'added:2008-12-01T22:45..' + +Find all items added on 2008-12-01, at or after 22:45:20 but before 22:45:41:: + + $ beet ls 'added:2008-12-01T22:45:20..2008-12-01T22:45:40' + +Examples of each time format:: + + $ beet ls 'added:2008-12-01T22:45:20' + $ beet ls 'added:2008-12-01t22:45:20' + $ beet ls 'added:2008-12-01 22:45:20' + .. _not_query: Query Term Negation