[DOCS](function) Add docs for new time functions (#12382)

Add docs for new time functions
This commit is contained in:
Gabriel
2022-09-06 19:33:41 +08:00
committed by GitHub
parent 7c2da89518
commit b398fd60fc
4 changed files with 87 additions and 1 deletions

View File

@ -43,5 +43,27 @@ mysql> select current_timestamp();
| 2019-05-27 15:59:33 |
+---------------------+
```
`DATETIMEV2 NOW(INT precision)`
Get the current time and return it in DatetimeV2 type.
Precision represents the second precision that the user wants. The current precision supports up to microseconds, that is, the value range of precision is [0, 6].
### example
```
mysql> select current_timestamp(3);
+-------------------------+
| current_timestamp(3) |
+-------------------------+
| 2022-09-06 16:18:00.922 |
+-------------------------+
```
Note:
1. Currently, only DatetimeV2 type supports precision.
2. Limited by the JDK implementation, if you use jdk8 to build FE, the precision can be up to milliseconds (three decimal places), and the larger precision bits will be filled with 0. If you need higher accuracy, please use jdk11 to build FE.
### keywords
CURRENT_TIMESTAMP,CURRENT,TIMESTAMP

View File

@ -31,7 +31,7 @@ under the License.
`DATETIME NOW ()`
Get the current time and return it in Datetime type
Get the current time and return it in Datetime type.
### example
@ -43,5 +43,27 @@ mysql> select now();
| 2019-05-27 15:58:25 |
+---------------------+
```
`DATETIMEV2 NOW(INT precision)`
Get the current time and return it in DatetimeV2 type.
Precision represents the second precision that the user wants. The current precision supports up to microseconds, that is, the value range of precision is [0, 6].
### example
```
mysql> select now(3);
+-------------------------+
| now(3) |
+-------------------------+
| 2022-09-06 16:13:30.078 |
+-------------------------+
```
Note:
1. Currently, only DatetimeV2 type supports precision.
2. Limited by the JDK implementation, if you use jdk8 to build FE, the precision can be up to milliseconds (three decimal places), and the larger precision bits will be filled with 0. If you need higher accuracy, please use jdk11 to build FE.
### keywords
NOW

View File

@ -44,6 +44,27 @@ mysql> select current_timestamp();
+---------------------+
```
`DATETIMEV2 CURRENT_TIMESTAMP(INT precision)`
获得当前的时间,以DatetimeV2类型返回
precision代表了用户想要的秒精度,当前精度最多支持到微秒,即precision取值范围为[0, 6]。
### example
```
mysql> select current_timestamp(3);
+-------------------------+
| current_timestamp(3) |
+-------------------------+
| 2022-09-06 16:18:00.922 |
+-------------------------+
```
注意:
1. 当前只有DatetimeV2数据类型可支持秒精度
2. 受限于JDK实现,如果用户使用JDK8构建FE,则精度最多支持到毫秒(小数点后三位),更大的精度位将全部填充0。如果用户有更高精度需求,请使用JDK11。
### keywords
CURRENT_TIMESTAMP,CURRENT,TIMESTAMP

View File

@ -44,6 +44,27 @@ mysql> select now();
+---------------------+
```
`DATETIMEV2 NOW(INT precision)`
获得当前的时间,以DatetimeV2类型返回
precision代表了用户想要的秒精度,当前精度最多支持到微秒,即precision取值范围为[0, 6]。
### example
```
mysql> select now(3);
+-------------------------+
| now(3) |
+-------------------------+
| 2022-09-06 16:13:30.078 |
+-------------------------+
```
注意:
1. 当前只有DatetimeV2数据类型可支持秒精度
2. 受限于JDK实现,如果用户使用JDK8构建FE,则精度最多支持到毫秒(小数点后三位),更大的精度位将全部填充0。如果用户有更高精度需求,请使用JDK11。
### keywords
NOW