cancel
Showing results for 
Search instead for 
Did you mean: 

How to get previous date from a date

archana
Node

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"  │
└──────────────┘

archana
Node

Thanks Paul, it worked