Tinderbox's date parser accepts the following expressions as placeholders for calculated dates:
All provide a date/time, with the seconds element of time coerced to '00'. today and now return exactly the same value. The alternate designators can make for more intuitive use in code in different contexts.
The following designators can be used to modify the above. However, if simply used on their own, rather than as a modifier they don't return a valid date/time:
There is a further special case:
- never. No date - earlier or later than any real date.
Treat usage for the above as case sensitive.
Day placeholders - Sunday, Monday, etc. - may also be used. Tinderbox recognises the day of the week (in English, currently) and interprets it as the day after today with that week day. Thus on Sunday June 1, the date "Sunday" refers to Sunday, June 8.
In other respects, days of the week act like today and can be modified similarly, e.g. "Monday - 1" week is the previous Monday.
Dates may be modified by adding and subtracting "minutes", 'hours", "days", "weeks" and "years":
Explicit (24-hour clock) time can be used - in which case it comes at the end of the string:
"today+7 days 00:00"
The latter is useful to ensure that a base like 'today' or 'now' that take system clock time are set to to an exact known time, as may be needed for accurate date comparison.
Note that the date arguments are written as quoted strings which my include addition/subtraction signs. This format is deprecated:
"today" +" 65 minutes"
If using Attribute values in a date expression simple use the $-prefixed attribute name outside the quoted string:
From v5.6.0, if modifying a date and the expression part of code can not be parsed as a date modified, the unmodified date is returned; this avoids unintentional creation of undefined ('never') dates.