apoc.date.fromISO8601

This function is deprecated. Use Cypher’s datetime() function instead.

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

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