# Date Time Processing

> Date/Time processing The 'evaluation time’ - $now() There are two functions that return the 'current' date/time timestamp: 1. [ $now()…

Source: https://www.fuuz.com/help/date
Last updated: 2025-12-26

How-To Guides · Expressions and scripting


Last updated December 26, 2025, 8:12 PM UTC

## Date/Time processing

## The 'evaluation time’ - $now()

There are two functions that return the 'current' date/time timestamp:

1. [`$now()`](date-time-functions#now) returns the timestamp in an ISO 8601 formatted string.

2. [`$millis()`](date-time-functions#millis) returns the same timestamp as the number of milliseconds since midnight on 1st January 1970 UTC (the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)).

The timestamp is captured at the start of the expression evaluation, and that same timestamp value is returned for every occurrence of `$now()` and `$millis()` in the same expression for the duration of the evaluation.

**Example**

- The timestamp will be the same for all invocations within an expression

<div class="jsonata-ex">

<div>{

"invoiceTime": $now(),

"total": $sum(Account.Order.Product.(Price \* Quantity)),

"closingTime": $now()

}</div>

<div>{

"invoiceTime": "2018-12-10T13:49:51.141Z",

"total": 336.36,

"closingTime": "2018-12-10T13:49:51.141Z"

}</div>

</div>

## JSON and ISO 8601

JSON does not have a built-in type for date/time values. The general [consensus](https://stackoverflow.com/a/15952652/7079134) is to store the date/time value as a string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.

**Example**

```

{
    "myDateTime": "2018-12-10T13:45:00.000Z"
}

```
JSONata follows this convention and provides functions for formatting and parsing ISO 8601 formatted timestamps

([`toMillis()`](date-time-functions#tomillis) and [`fromMillis()`](date-time-functions#frommillis))

## Support for other date/time formats

Since there is no standard for date/time format in JSON, it is entirely possible that the JSON data you are working with will have date/time values formatted in other ways. JSONata supports the highly versatile picture string notation from the XPath/XQuery [fn:format-dateTime()](https://www.w3.org/TR/xpath-functions-31/#func-format-dateTime) specification for both the formatting and parsing of a wide variety of date/time formats.

See [`toMillis()`](date-time-functions#tomillis) and [`fromMillis()`](date-time-functions#frommillis) for details.

**Examples**

- The date `12/10/2018` in US format and `10/12/2018` in European format both refer to the same day.

<div class="jsonata-ex">

<div>$toMillis('10/12/2018', '[D]/[M]/[Y]') ~> $fromMillis('[M]/[D]/[Y]')</div>

<div>"12/10/2018"</div>

</div>

- More verbose format.

<div class="jsonata-ex">

<div>$toMillis('10/12/2018', '[D]/[M]/[Y]')

~> $fromMillis('[FNn], [D1o] [MNn] [YI]')</div>

<div>"Monday, 10th December MMXVIII"</div>

</div>

### Need more help?

Ask the Fuuz community, or open a ticket with Fuuz support.

[Ask the community](https://www.fuuz.com/community) [Open a ticket](https://support.fuuz.com/portal/en/newticket)

On this page

[Date/Time processing](#date-time-processing)

[The 'evaluation time’ - $now()](#the-evaluation-time-now)

[JSON and ISO 8601](#json-and-iso-8601)

[Support for other date/time formats](#support-for-other-date-time-formats)
