Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bison datetime parser #1330

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 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 @@ -12,14 +12,18 @@

- 函数`date()`、`time()`和`datetime()`可以用属性名称获取自身的某一个具体属性值,例如`date().month`获取当前月份、`time("02:59:40").minute`获取传入时间的分钟数。

- 函数`date()`、`time()`和`datetime()`可以指定时区进行转换,例如`datetime("2017-03-04 22:30:40.003000+08:00")`或`datetime("2017-03-04T22:30:40.003000[Asia/Shanghai]")`。

## openCypher 兼容性

- 支持年、月、日、时、分、秒,不支持毫秒
- 支持年、月、日、时、分、秒、毫秒、微秒,不支持纳秒

- 不支持函数`localdatetime()`和`duration()`。

- 不支持大部分字符串时间格式,支持`YYYY-MM-DDThh:mm:ss`和`YYYY-MM-DD hh:mm:ss`。

- 支持单个数字的字符串时间格式,例如`time("1:1:1")`。

## DATE

`DATE`包含日期,但是不包含时间。Nebula Graph 检索和显示`DATE`的格式为`YYYY-MM-DD`。支持的范围是`-32768-01-01`到`32767-12-31`。
Expand Down Expand Up @@ -83,7 +87,7 @@
2. 插入点,名称为`test1`。

```ngql
nebula> INSERT VERTEX date1(p1, p2, p3) VALUES "test1":(date("2021-03-17"), time("17:53:59"), datetime("2021-03-17T17:53:59"));
nebula> INSERT VERTEX date1(p1, p2, p3) VALUES "test1":(date("2021-03-17"), time("17:53:59"), datetime("2017-03-04T22:30:40.003000[Asia/Shanghai]"));
```

3. 获取`test1`的属性`p1`的月份。
Expand Down