apoc.date.toISO8601

Function APOC Core

apoc.date.toISO8601(12345,('ms|s|m|h|d') - return string representation of time in ISO8601 format

Signature

apoc.date.toISO8601(time :: INTEGER?, unit = ms :: STRING?) :: (STRING?)

Input parameters

Name Type Default

time

INTEGER?

null

unit

STRING?

ms

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;
Table 1. Results
iso8601

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