NOW
returns the current date and time. Use coerce.to-integer and coerce.to-string to convert the result to seconds and a date/time string, respectively.
The structure of the date response returned follows the ISO 8601 standard.
+ / - operations can be used with the MONTH
function, such as MONTH() - 3
or MONTH() + 1
.
Function category: Date​
NOW()
Arguments | Description |
None | Takes no arguments and always returns the current date and time. |
Using the coercion functions with the NOW()
function formats the timestamp as either seconds or data/time formats.
The base result for NOW()
is milliseconds.
NOW()## results in a timestamp in milliseconds#["LocalDateTime",1600182953097]
Adding coerce.to-integer
to NOW()
results in a timestamp in seconds.
coerce.to-integer(NOW())## results in a timestamp in seconds#1599655794
Adding coerce.to-string
to NOW()
results in a ISO 8601 date/time format.
coerce.to-string(NOW())## results in a date/time as a string#"2020-09-09T14:53:50.977"