Neo4j temporal date - post going to expiry


(Gchokeen) #1

I want to show to user the post going to expiry with in 23:05:10 (hh:mm:ss) but the below query working opposite (01:55:50) if the expiry time is not belongs to today. If expiry time in same date yes it working properly, can anyone tell me how to fix it

with duration.between(post.expiry,datetime()) as expiry return apoc.text.format('%02d:%02d:%02d', [expiry.hours, expiry.minutesOfHour, expiry.secondsOfMinute])

Thanks
Gowri


(Andrew Bowman) #2

Try using duration.inSeconds() instead of duration.between() for this.


(Gchokeen) #3

Thank you so much andrew, that fixed the issue