Skip to content

Commit

Permalink
Update 4.date-and-time.md (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomJoe211 authored Jan 13, 2022
1 parent 8e5430d commit 472194b
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions docs-2.0/3.ngql-guide/3.data-types/4.date-and-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,27 @@ The `TIMESTAMP` data type is used for values that contain both date and time par
- Supported `TIMESTAMP` inserting methods: timestamp, `timestamp()` function, and `now()` function.

- `timestamp()` function accepts empty parameters to get the timestamp of the current timezone and also accepts a string type parameter.

```ngql
# Return the current time.
nebula> RETURN timestamp();
+-------------+
| timestamp() |
+-------------+
| 1625469277 |
+-------------+
# Return the specified time.
nebula> RETURN timestamp("2021-07-05T06:18:43.984000");
+-----------------------------------------+
| timestamp("2021-07-05T06:18:43.984000") |
+-----------------------------------------+
| 1625465923 |
+-----------------------------------------+
```

```ngql
# Return the current time.
nebula> RETURN timestamp();
+-------------+
| timestamp() |
+-------------+
| 1625469277 |
+-------------+
nebula> RETURN timestamp("2022-01-05T06:18:43");
+----------------------------------+
| timestamp("2022-01-05T06:18:43") |
+----------------------------------+
| 1641363523 |
+----------------------------------+
```
!!! compatibility "Legacy version compatibility"
In Nebula Graph versions earlier than 3.0.0, the time string passed into the timestamp() function could include milliseconds and microseconds. As of version 3.0.0, the time string passed into the timestamp() function cannot include milliseconds and microseconds.
- The underlying storage data type is **int64**.
Expand Down

0 comments on commit 472194b

Please sign in to comment.