apoc.date.parse

Details

Syntax

apoc.date.parse(time [, unit, format, timezone ])

Description

Parses the given date STRING from a specified format into the specified time unit.

Arguments

Name

Type

Description

time

STRING

The datetime to convert.

unit

STRING

The conversion unit. The default is: ms.

format

STRING

The format the given datetime is in. The default is: yyyy-MM-dd HH:mm:ss.

timezone

STRING

The timezone the given datetime is in. The default is: ``.

Returns

INTEGER

Usage Examples

The following converts a date string into epoch milliseconds:

RETURN apoc.date.parse("2020-11-04", "ms", "yyyy-MM-dd") AS outputInMs;
Results
outputInMs

1604448000000