Skip to content

Built-in date and time functions

NebulaGraph supports the following built-in date and time functions:

Function Description
int now() Returns the current timestamp of the system.
timestamp timestamp() Returns the current timestamp of the system.
date date() Returns the current UTC date based on the current system.
time time() Returns the current UTC time based on the current system.
datetime datetime() Returns the current UTC date and time based on the current system.
map duration() Returns the period of time. It can be used to calculate the specified time.

For more information, see Date and time types.

Examples

nebula>  RETURN now(), timestamp(), date(), time(), datetime();
+------------+-------------+------------+-----------------+----------------------------+
| now()      | timestamp() | date()     | time()          | datetime()                 |
+------------+-------------+------------+-----------------+----------------------------+
| 1640057560 | 1640057560  | 2021-12-21 | 03:32:40.351000 | 2021-12-21T03:32:40.351000 |
+------------+-------------+------------+-----------------+----------------------------+

Last update: October 24, 2023