Search code examples
datetimeneo4jtimestampneo4j-apoc

Convert datetime to timestamp in Neo4j


How to convert datetime in data loaded in Neo4j to timestamp? Example datetime format: 2020-04-07T12:39:38.027Z Please assist.


Solution

  • Neo4's temporal instants (like datetime) have a special variable, epochMillis, that provides the equivalent epoch time.

    For example:

    RETURN datetime('2020-04-07T12:39:38.027Z').epochMillis
    

    returns

    1586263178027