Document toolboxDocument toolbox

Entering Relative Dates and Times

In Step 2 of the Custom Report Wizard, you specify one or more attributes as report filters. If an attribute involves a date or date/time, its argument can be specified as a relative date. This enables arguments including the following:

  • now (which resolves to current time, i.e., time that the report executes)
  • yesterday, today, tomorrow (which resolves to midnight of the respective day, where "today" is the day the report is executes)
  • 3 days ago
  • 10 days since 2010-01-15 (which resolves to 1/25/10)
  • 1 month after first day of year (which resolves to February 1)
  • First day of the month 1 month from today (which resolves to the first day of next month)
  • Last day of the month (which resolves to the last day of today's month)

A valid relative date argument string is a list of space-delimited <datestr>s, which are defined as:

<datestr> = CONSTANT | <relative>

where

CONSTANT = <date time> in the format yyyy-mm-dd HH:MM:SS, or <date> in the format yyyy-mm-dd (which resolves to midnight, i.e., 00:00:00, on that date)

<relative> = today | yesterday | tomorrow | now | <which> day <dateinterval> | [<number> <interval> <direction>] | starttime | endtime

(starttime resolves to midnight, i.e., 00:00:00, on the starting day of the period covered by the report, which is specified by the user when running or scheduling the report. endtime resolves to midnight, i.e., 00:00:00, on the day after the ending day of the period covered by the report, which is specified by the user when running or scheduling the report.)

<which> = first | last

<dateinterval> = year | month | week

<number> = an integer

<interval> = <dateinterval> | hour | minute | second

<direction> = ago | before | until | after | since | from

where ( ago = until = before ) and ( after = since = from )

Of and the are ignored throughout the string, but can be included to make the string more readable, and plural forms are correctly interpreted (e.g., days = day).