Calculating Date Differentials In Neo4j

You may also like...

5 Responses

  1. Have you seen the apoc library with it’s apoc.date.parse and apoc.date.format functions(3.1) / procedures (3.0) ?

    https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_date_time_support

    MATCH (task:Task)-[:HAS_STATE]-(state:TaskState)
    WITH apoc.date.parse(task.CreatedUtc,’s’,’yyyy-MM-dd’) as task_s,
    apoc.date.parse(state.CreatedUtc,’s’,’yyyy-MM-dd’) as state_s
    RETURN apoc.date.format(state_s – task_s, ‘s’, ‘D’) as deltaDays