cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to get previous date from a date

Hello there,
I am working with Neo4j dates, I want to get previous date from a date for example if "2019-01-01" is current date then i want "2018-12-31" as previous date.

Is there any way to get the previous date of a date in Neo4j using cypher?
Thanks in advance.

2 REPLIES 2

paulare
Graph Buddy
RETURN date('2019-01-01')- duration({days: 1}) as previousDate

╒══════════════╕
│"previousDate"│
╞══════════════╡
│"2018-12-31"  │
└──────────────┘

Thanks Paul, it worked