Skip to main content

$now

$now(picture?, timezone?) -> string
Browse categories

Source: JSONata

Documentation

Generates a UTC timestamp in ISO 8601 compatible format and returns it as a string. All invocations of $now() within an evaluation of an expression will all return the same timestamp value.

If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the $fromMillis() function.

Examples

Basic usage

  • $now() => "2017-05-15T15:12:59.152Z"

Get the type of $now()

Input

null

Expression

$type($now())

Result

"string"

Show that repeated calls are stable within one evaluation

Input

null

Expression

$now() = $now()

Result

true