apoc.date.parse

Function APOC Core

apoc.date.parse('2012-12-23','ms|s|m|h|d','yyyy-MM-dd') - parse date string using the specified format into the specified time unit

Signature

apoc.date.parse(time :: STRING?, unit = ms :: STRING?, format = yyyy-MM-dd HH:mm:ss :: STRING?, timezone =  :: STRING?) :: (INTEGER?)

Input parameters

Name Type Default

time

STRING?

null

unit

STRING?

ms

format

STRING?

yyyy-MM-dd HH:mm:ss

timezone

STRING?

Usage Examples

The following converts a date string into epoch milliseconds:

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

1604448000000