Neo4j temporal date - post going to expiry

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])


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


Thank you so much andrew, that fixed the issue