Neo4j: Temporal unctions – Duration cheat sheet

Syntax:

duration([ {years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds} ])

Creating a Duration from a string:

duration(temporalAmount)

duration.between()

duration.between(instant1, instant2)

Returns the Duration value equal to the difference between the two given instants.

duration.inMonths()

duration.inMonths(instant1, instant2)

Returns the Duration value equal to the difference in whole months, quarters or years between the two given instants.

duration.inDays()

duration.inDays(instant1, instant2)

Returns the Duration value equal to the difference in whole days or weeks between the two given instants.

duration.inSeconds()

duration.inSeconds(instant1, instant2)

Returns the Duration value equal to the difference in seconds and fractions of seconds, or minutes or hours, between the two given instants.

Leave a Reply

Your email address will not be published. Required fields are marked *