apoc.date.add
Syntax |
|
||
Description |
Adds a unit of specified time to the given timestamp. |
||
Arguments |
Name |
Type |
Description |
|
|
The timestamp to add time to. |
|
|
|
The unit the given timestamp is in. |
|
|
|
The amount of time to add to the given timestamp. |
|
|
|
The unit the added value is in. |
|
Returns |
|
Usage Examples
The
The computed value will be in the unit specified by the |
The following adds 10,000 milliseconds to the current datetime:
WITH apoc.date.add(datetime().epochMillis, "ms", 10000, "ms") AS output
RETURN outputinMs, datetime({epochMillis: output}) AS datetime;
outputinMs | datetime |
---|---|
1604509597386 |
2020-11-04T17:06:37.386Z |
The following adds 1 day to the current datetime:
WITH apoc.date.add(datetime().epochMillis, "ms", 1, "day") AS output
RETURN outputinMs, datetime({epochMillis: output}) AS datetime;
outputinMs | datetime |
---|---|
1604596506209 |
2020-11-05T17:15:06.209Z |
The following adds 1 hour to 12 hours:
RETURN apoc.date.add(12, "hour", 1, "hour") AS outputinHours
outputinHours |
---|
13 |
The following adds 1 hour to 34 minutes:
RETURN apoc.date.add(34, "minutes", 1, "hour") AS outputInMinutes;
outputInMinutes |
---|
94 |