Relative Date and Time
How to use the RelativeDate and RelativeDateTime value types
The RelativeDate
value type represents the date occurring a number of days before/after a specific date, e.g. 2 days before end of week, 5 days from today.
The RelativeDateTime
value type represents the date and time occurring a number of time units before/after a specific date and time, e.g. 1 hour 30 minutes before end of day, 2 days 8 hours from now.
Properties
Property Name | Type | Required | Description |
---|---|---|---|
relativeTo | string[] | true | A string value equal to one of the defined Relative To values. |
value | string[] | true | A string value in the format (-)0.00:00:00.000 representing days.hours.minutes.seconds.milliseconds after relativeTo (or before if prefixed with - ). |
Allowed Children
None
Requirements
relativeTo
must equal a defined Relative To value:
Now
- current timeStartOfDay
- today at00:00:00:000
EndOfDay
- today at23:59:59:999
LastMonday
- last Monday at00:00:00:000
(if today is Monday, it'll be last week)StartOfWeekMonday
- start of the week at00:00:00:000
(if today is Monday, it'll be today)StartOfMonth
- the first of this month at00:00:00:000
.EndOfMonth
- the last of this month at23:59:59:999
.StartOfYear
- the 1st January this year at00:00:00:000
.EndOfYear
- the 31st December this year at23:59:59:999
.
Return Type
date[ ]
Examples
5 days from today:
{
"type": "RelativeDate",
"properties": {
"relativeTo": "Now",
"value": ["5.00:00:00.000"]
}
}
1 hour 30 mins before end of day:
{
"type": "RelativeDateTime",
"properties": {
"relativeTo": "EndOfDay",
"value": ["-0.01:30:00.000"]
}
}