Skip to content

Commit b1b4272

Browse files
committed
Refinements to the relative date docs
1 parent 690ed73 commit b1b4272

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

docs/reference/query.rst

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,27 +217,24 @@ queries do the same thing::
217217
$ beet ls 'added:2008-12-01t22:45:20'
218218
$ beet ls 'added:2008-12-01 22:45:20'
219219

220-
You can also use relative dates to the current time.
221-
It looks like ``-3w``, ``2m`` or ``-4d`` which means the date 3 weeks ago,
222-
the date 2 months from now and the date 4 days ago.
223-
A relative date consists of three parts:
224-
- ``+`` or ``-`` sign is optional and defaults to ``+``. The ``+`` sign will
225-
add a time quantity to the current date while the ``-`` sign will do the
226-
opposite
227-
- a number follows and indicates the amount to add or substract
228-
- a final letter ends and represents the amount in either days, weeks, months or
229-
years (``d``, ``w``, ``m`` or ``y``)
230-
231-
Please note that this relative calculation makes the assumption of 30 days per
232-
month and 365 days per year.
233-
234-
Here is an example that finds all the albums added between now and last week::
220+
You can also use *relative* dates. For example, ``-3w`` means three weeks ago,
221+
and ``+4d`` means four days in the future. A relative date has three parts:
222+
223+
- Either ``+`` or ``-``, to indicate the past or the future. The sign is
224+
optional; if you leave this off, it defaults to the future.
225+
- A number.
226+
- A letter indicating the unit: ``d``, ``w``, ``m`` or ``y``, meaning days,
227+
weeks, months or years. (A "month" is always 30 days and a "year" is always
228+
365 days.)
229+
230+
Here's an example that finds all the albums added since last week::
235231

236232
$ beet ls -a 'added:-1w..'
237233

238-
Find all items added in a 2 weeks period 4 weeks ago::
234+
And here's an example that lists items added in a two-week period starting
235+
four weeks ago::
239236

240-
$ beet ls -a 'added:-6w..-4w'
237+
$ beet ls 'added:-6w..-4w'
241238

242239
.. _not_query:
243240

0 commit comments

Comments
 (0)