The date keyword functions can be used to alter the date which is provided when using a keyword. In the table below, replace the $KEY text by your date keyword.
| unction | Description |
|---|---|
| $KEY.minusYears(number) | Returns the date with the specified number of years subtracted. |
| $KEY.plusYears(number) | Returns the date with the specified number of years added. |
| $KEY.minusMonths(number) | Returns the date with the specified number of months subtracted. |
| $KEY.plusMonths(number) | Returns the date with the specified number of months added. |
| $KEY.minusDays(number) | Returns the date with the specified number of days subtracted. |
| $KEY.plusDays(number) | Returns the date with the specified number of days added. |
| $KEY.minusHours(number) | Returns the date with the specified number of hours subtracted. |
| $KEY.plusHours(number) | Returns the date with the specified number of hours added. |
| $KEY.minusMinutes(number) | Returns the date with the specified number of minutes subtracted. |
| $KEY.plusMinutes(number) | Returns the date with the specified number of minutes added. |
| $KEY.minusSeconds(number) | Returns the date with the specified number of seconds subtracted. |
| $KEY.plusSeconds(number) | Returns the date with the specified number of seconds added. |
| $date.format($KEY) | Returns the date in the default format (dd/MM/yyyy HH:mm:ss). |
| $date.format(format, $KEY) | Returns the date in the provided format. The provided format is a combination of the tokens from the table below. |
Date format tokens
| Token | Description |
|---|---|
| y | Year |
| D | Day of the year |
| M | Month of the year |
| d | Day of the month |
| a | AM or PM |
| h | Hour of the day (1-12) |
| K | Hour of the day (0-11) |
| k | Hour of the day (1-12) |
| H | Hour of the day (0-23) |
| m | Minute of the hour (0-60) |
| s | Second of the minute (0-60) |
Report type examples
| Notation | Description |
|---|---|
| $date.format(“dd/MM/yyyy”,$reportDate.minusDays(7)) | The date returned by the $KEY entry will be deducted with 7 days and be formatted as dd/MM/yyyy. |
| $date.format(“yyyyMMdd”,$KEY.minusHours(1)) | The date returned by the $KEY entry will be deducted with 1 hour and be formatted as yyyyMMdd. |