提交 aa3a9dd6 编写于 作者: K kailixu

docs: latest timestamp allowed when inserting data

上级 6618ff19
......@@ -27,7 +27,7 @@ INSERT INTO tb_name [(field1_name, ...)] subquery
2. The precision of a timestamp depends on its format. The precision configured for the database affects only timestamps that are inserted as long integers (UNIX time). Timestamps inserted as date and time strings are not affected. As an example, the timestamp 2021-07-13 16:16:48 is equivalent to 1626164208 in UNIX time. This UNIX time is modified to 1626164208000 for databases with millisecond precision, 1626164208000000 for databases with microsecond precision, and 1626164208000000000 for databases with nanosecond precision.
3. If you want to insert multiple rows simultaneously, do not use the NOW function in the timestamp. Using the NOW function in this situation will cause multiple rows to have the same timestamp and prevent them from being stored correctly. This is because the NOW function obtains the current time on the client, and multiple instances of NOW in a single statement will return the same time.
The earliest timestamp that you can use when inserting data is equal to the current time on the server minus the value of the KEEP parameter(You can configure the KEEP parameter when you create a database and the default value is 3650 days). The latest timestamp you can use when inserting data depends on the PRECISION parameter (You can configure the PRECISION parameter when you create a database, ms means milliseconds, us means microseconds, ns means nanoseconds, and the default value is milliseconds): If the timestamp precision is milliseconds or microseconds, the values is 00:00:00.000 UTC on 1 January 1970 plus 1000 years, that is, 00:00:00.000 UTC on 1 January 2970; If the timestamp precision is nanoseconds, the value is 00:00:00.000000000 UTC on 1 January 1970 plus 292 years, that is,00:00:00.000000000 UTC on 1 January 2262.
The earliest timestamp that you can use when inserting data is equal to the current time on the server minus the value of the KEEP parameter (You can configure the KEEP parameter when you create a database and the default value is 3650 days). The latest timestamp you can use when inserting data depends on the PRECISION parameter (You can configure the PRECISION parameter when you create a database, ms means milliseconds, us means microseconds, ns means nanoseconds, and the default value is milliseconds). If the timestamp precision is milliseconds or microseconds, the latest timestamp is 00:00:00.000 UTC on 1 January 1970 plus 1000 years, that is, 00:00:00.000 UTC on 1 January 2970; If the timestamp precision is nanoseconds, the latest timestamp is 00:00:00.000000000 UTC on 1 January 1970 plus 292 years, that is, 00:00:00.000000000 UTC on 1 January 2262.
**Syntax**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册