Matching reference times¶
Syntax: reftime:<operator><date>[,<operator><date>...]
A reftime matcher is a sequence of expressions separated by a comma. All the expressions are ANDed together.
Valid operators are: >=, >, <=, <, ==, =.
For example: reftime:=2010-05-03 12:00:00 matches midday on the 3rd of May.
A date can be specified partially, and it will be considered as a time
interval. For example, reftime:=2007-01 matches from midnight of the 1st of
January 2007 to 23:59:59 of the 31st of January 2007, inclusive.
It is also possible to specify the time, without the date: >=12, >=12:00
and >=12:00:00 all mean “between midday and midnight of any day”. >12 means
“from 13:00:00 until midnight”. =12 means “from 12:00:00 to 12:59:59”.
Finally, it is possible to specify a time step: >=2007-06-05 04:00:30%12h
means “anything from 04:00:30 June 5, 2007, but only at precisely 04:00:30 and
18:00:30”.
The time step can be given in hours, minutes, seconds or any of their
combinations. For example: 12h, 30m, 12h30m15s.
Dates and times can also be specified relative to the curren time:
now: current date and timetoday: current date
There are also aliases for commonly used bits:
reftime:=yesterdayis equivalent toreftime:=today - 1 dayreftime:=tomorrowis equivalent toreftime:=today + 1 dayreftime:=middayis equivalent toreftime:=12:00:00reftime:=noonis equivalent toreftime:=12:00:00reftime:=midnightis equivalent toreftime:=00:00:00
Dates can be altered using +, -, ago, before, after.
For example:
reftime:=2 days before yesterdayis equivalent toreftime:=today - 3 daysreftime:=1 hour and 30 minutes after tomorrow midnightis equivalent toreftime:=tomorrow 01:30:00reftime:=1 hour after today middayis equivalent toreftime:=today 13:00:00reftime:=processione san luca 2010is equivalent toreftime:=34 days after easter 2010
You can use arki-dump --query 'reftime:...' to check how a query gets parsed.
Examples¶
Given reftime 2010-09-08 07:06:05:
Year intervals:
reftime:>=2010matchesreftime:<=2010matchesreftime:==2010matchesreftime:>2009matchesreftime:<2011matchesreftime:<2010does not matchreftime:>2009,<2011matchesreftime:>2009,<2010does not match
Month intervals:
reftime:>=2010-09matchesreftime:<=2010-09matchesreftime:==2010-09matchesreftime:>2010-08matchesreftime:<2010-10matchesreftime:<2010-09does not matchreftime:>2010-08,<2010-10matchesreftime:>2010-08,<2010-09does not match
Day intervals:
reftime:>=2010-09-08matchesreftime:<=2010-09-08matchesreftime:==2010-09-08matchesreftime:>2010-09-07matchesreftime:<2010-09-09matchesreftime:<2010-09-08does not matchreftime:>2010-09-07,<2010-09-09matchesreftime:>2010-09-07,<2010-09-08does not match
Hour intervals:
reftime:>=2010-09-08 07matchesreftime:<=2010-09-08 07matchesreftime:==2010-09-08 07matchesreftime:>2010-09-08 06matchesreftime:<2010-09-08 08matchesreftime:<2010-09-08 07does not matchreftime:>2010-09-08 06,<2010-09-08 08matchesreftime:>2010-09-08 06,<2010-09-08 07does not match
Minute intervals:
reftime:>=2010-09-08 07:06matchesreftime:<=2010-09-08 07:06matchesreftime:==2010-09-08 07:06matchesreftime:>2010-09-08 07:05matchesreftime:<2010-09-08 07:07matchesreftime:<2010-09-08 07:06does not matchreftime:>2010-09-08 07:05,<2010-09-08 07:07matchesreftime:>2010-09-08 07:05,<2010-09-08 07:06does not match
Precise timestamps:
reftime:>=2010-09-08 07:06:05matchesreftime:<=2010-09-08 07:06:05matchesreftime:==2010-09-08 07:06:05matchesreftime:>2010-09-08 07:06:04matchesreftime:<2010-09-08 07:06:06matchesreftime:<2010-09-08 07:06:05does not matchreftime:>2010-09-08 07:06:04,<2010-09-08 07:06:06matchesreftime:>2010-09-08 07:05:04,<2010-09-08 07:06:05does not match
Hour expressions:
reftime:=07matchesreftime:>06matchesreftime:<08matchesreftime:>07does not match: same as>=08reftime:=07:06matchesreftime:>07:05matchesreftime:<08:00matchesreftime:>07:06does not match: same as>=07:07reftime:=07:06:05matchesreftime:>07:06:04matchesreftime:<07:06:06matchesreftime:>07:06:05does not matchreftime:<07:06:05does not match
Time steps:
reftime:>=2010-09-08 %5smatchesreftime:%5smatchesreftime:%2sdoes not match