I´m starting with neo4j and would like to know how to get the age in years. I have the node below
(p1:Person{id:1,birthdate:"1989-10-03",name:"Person1"})
tried something like this
with p.birthdate as bd, date() as d return d - bd
You can use date
and duration
types, for instance like this:
MATCH (p:Person {name: "Person1"})
WITH duration.between(date(p.birthdate), date()) as d
RETURN d, d.years, d.months, d.days