Skip to content

Commit

Permalink
Update using time string in timestamp function (#1383)
Browse files Browse the repository at this point in the history
* Update using time string in timestamp function

* Update 4.date-and-time.md

* Update 4.date-and-time.md
  • Loading branch information
randomJoe211 committed Jan 13, 2022
1 parent cd9b598 commit aa94c27
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 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 @@ -57,24 +57,28 @@
- 插入`TIMESTAMP`的方式包括时间戳、`timestamp()`函数和`now()`函数。

- `timestamp()`函数支持传入空值获取当前时区的时间戳,还接受 string 类型的参数。

```ngql
# 传入当前时间。
nebula> RETURN timestamp();
+-------------+
| timestamp() |
+-------------+
| 1625469277 |
+-------------+
# 传入指定时间。
nebula> RETURN timestamp("2021-07-05T06:18:43.984000");
+-----------------------------------------+
| timestamp("2021-07-05T06:18:43.984000") |
+-----------------------------------------+
| 1625465923 |
+-----------------------------------------+
```

```ngql
# 传入当前时间。
nebula> RETURN timestamp();
+-------------+
| timestamp() |
+-------------+
| 1625469277 |
+-------------+
# 传入指定时间。
nebula> RETURN timestamp("2022-01-05T06:18:43");
+----------------------------------+
| timestamp("2022-01-05T06:18:43") |
+----------------------------------+
| 1641363523 |
+----------------------------------+
```

!!! compatibility "历史版本兼容性"

在 Nebula Graph 3.0.0 版本前,传入 timestamp() 函数的时间字符串可包含毫秒和微秒;从 3.0.0 版本起,传入 timestamp() 函数的时间字符串不支持包含毫秒和微秒。

- 底层存储的数据格式为** 64 位 int**

Expand Down

0 comments on commit aa94c27

Please sign in to comment.