$$date
Date formatting utility
input must be a Date in ISO-8601 format or Date or Instant
Useful to be used in conjunction with #now
as input
Usage
"$$date([format], ...):{input}"
ISO
Returns the ISO-8601 representation of the input date (to the specified precision set by digits
)
Usage
"$$date(ISO,[digits]):{input}"
Returns
string
(date-time
format)
Arguments
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
digits | integer | 0 /3 /-1 | -1 | Precision of seconds decimal digits (-1 means max; machine dependant, usually nanoseconds) |
Examples
Input
Definition
Output
"2020-12-31"
"$$date(ISO):$"
"2020-12-31T00:00:00Z"
"2020-12-31T00:00:00.123Z"
"$$date(ISO,0):$"
"2020-12-31T00:00:00Z"
GMT
RFC-1123 format
Usage
"$$date(GMT):{input}"
Returns
string
Examples
Input
Definition
Output
"2020-12-31T23:59:00.000Z"
"$$date(GMT):$"
"Thu, 31 Dec 2020 23:59:00 GMT"
DATE
Date part of ISO 8601,
Usage
"$$date(DATE):{input}"
Returns
string
(date
format)
Examples
Input
Definition
Output
"2020-12-31T23:59:00.000Z"
"$$date(DATE):$"
"2020-12-31"
EPOCH
Seconds passed since 1970-01-01; unless type
=MS
then milliseconds,
Usage
"$$date(EPOCH,[resolution]):{input}"
Returns
integer
Arguments
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
resolution | Enum | MS /S | S | Resolution of epoch |
Examples
Input
Definition
Output
"2020-12-31T23:59:00.000Z"
"$$date(EPOCH):$"
1609451940
"2020-12-31T23:59:00.000Z"
"$$date(EPOCH,MS):$"
1609451940000
FORMAT
Format using a date format pattern (Java style)
Usage
"$$date(FORMAT,<pattern>,[timezone]):{input}"
Returns
string
Arguments
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
pattern | String | Yes | Pattern to use | |
timezone | Enum | Java's ZoneId (with SHORT_IDS ) | "UTC" | Time zone to use |
Examples
Input
Definition
Output
"2020-12-31T23:59:00.000Z"
"$$date(FORMAT,'dd.MM.yyyy'):$"
"31.12.2020"
"2023-01-01T00:00:00Z"
"$$date(format,'yyyy-MM-dd HH:mm','America/New_York'):$"
"2022-12-31 19:00"
ADD / SUB
Add or subtract by chronological unit (ChronoUnit
, see Java docs) and amount respectively
Usage
"$$date(ADD,<units>,<amount>):{input}"
- Or:
"$$date(SUB,<units>,<amount>):{input}"
Returns
string
(date-time
format)
Arguments
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
units | Enum (ChronoUnit ) | SECONDS /MINUTES /DAYS / etc... | Yes | The units to add or subtract |
amount | integer | Yes | The amount to add or subtract |
Examples
Input
Definition
Output
"2020-12-31T23:59:00.000Z"
"$$date(ADD,DAYS,1):$"
"2021-01-01T23:59:00Z"
"2020-12-31T23:59:00.000Z"
"$$date(SUB,DAYS,1):$"
"2020-12-30T23:59:00Z"
ZONE
ISO-8601 with offset by specifying a timezone
Usage
"$$date(ZONE,<zone>):{input}"
Returns
string
(date-time
format)
Arguments
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
zone | Enum | Java's ZoneId (with SHORT_IDS ) | "UTC" | Time zone to use |