apoc.date.fromISO8601

Details

Syntax

apoc.date.fromISO8601(time)

Description

Converts the given date STRING (ISO8601) to an INTEGER representing the time value in milliseconds.

Arguments

Name

Type

Description

time

STRING

The datetime to convert to ms.

Returns

INTEGER

Parsing a datetime using Cypher

Cypher’s datetime() function also accepts STRING values formatted to the ISO8601 standard.

Usage Examples

The time parameter is a date string in the ISO8601 standard format

The following examples convert a date string in ISO 8601 format to epoch millis using both APOC and Cypher:

apoc.date.fromISO8601
RETURN apoc.date.fromISO8601('2020-11-04T12:21:33.000Z') AS outputInMs;
Using Cypher’s datetime() function
RETURN datetime('2020-11-04T12:21:33.000Z').epochMillis AS outputInMs;
Results
outputInMs

1604492493000