apoc.date.convert
Syntax |
|
||
Description |
Converts the given timestamp from one time unit into a timestamp of a different time unit. |
||
Arguments |
Name |
Type |
Description |
|
|
The timestamp to be converted. |
|
|
|
The unit the given timestamp is in. |
|
|
|
The unit to convert the given timestamp to. |
|
Returns |
|
Usage Examples
The
The computed value will be in the unit specified by the |
The following converts 30 minutes into seconds:
RETURN apoc.date.convert(30, "minutes", "seconds") as outputInSeconds;
outputInSeconds |
---|
1800 |
The following converts the current datetime in epoch seconds into the number of days since 1st January 1970:
RETURN apoc.date.convert(datetime().epochSeconds, "seconds", "days") as outputInDays;
outputInDays |
---|
18571 |