apoc.date.toISO8601

Details

Syntax

apoc.date.toISO8601(time [, unit ])

Description

Returns a STRING representation of a specified time value in the ISO8601 format.

Arguments

Name

Type

Description

time

INTEGER

The timestamp since epoch to format.

unit

STRING

The unit of the given timestamp. The default is: ms.

Returns

STRING

Usage Examples

The unit parameter supports the following values:

  • ms, milli, millis, milliseconds

  • s, second, seconds

  • m, minute, minutes

  • h, hour, hours

  • d, day, days

The following converts the current datetime in milliseconds to a date string in ISO8601 standard format:

RETURN apoc.date.toISO8601(datetime().epochMillis, "ms") AS iso8601;
Results
iso8601

"2020-11-05T14:21:58.179Z"