DATE
takes a year, month, and day as integers and returns a date object. Use coerce.to-integer or coerce-to-string convert the results to seconds or a date as a string, respectively. The structure of the date response returned follows the ISO 8601 standard.
+ / - operations can be used with the DATE
function, such as DATE() - 3600
or DATE() + 600
.
Function category: Date​
DATE(arg1, arg2, arg3)
Arguments | Description |
| Integer representing the year. |
| Integer representing the month. |
| Integer representing the day. |
​
Using the coercion functions with the DATE()
function formats the timestamp as either seconds or data/time formats.
The base result for DATE()
is in milliseconds.
DATE(2020, 08, 19)## results in a date in milliseconds#["LocalDate",1597795200000]
Adding coerce.to-integer
to DATE()
results in a timestamp in seconds.
coerce.to-integer(DATE(2020, 08, 19))## results in a timestamp in seconds#1597795200
Adding coerce.to-string
to DATE()
results in a ISO 8601 date/time format.
coerce.to-string(DATE(2020, 08, 19))## results in YYYY-MM-DD#"2020-08-19"