Skip to content

Built-in date and time functions

Nebula Graph supports the following built-in date and time functions:

Function Description
int now() Returns the current date and time of the system time zone.
timestamp timestamp() Returns the current date and time of the system time zone.
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: August 12, 2022