Merge pull request #27462 from taosdata/docs/3.0/TD-31673

docs:[TD-31673] Update description of timetruncate function to clarify week truncation behavior based on Unix epoch starting on Thursday.
This commit is contained in:
dapan1121 2024-08-26 16:38:25 +08:00 committed by GitHub
commit 155d7548d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -656,6 +656,7 @@ use_current_timezone: {
For example, if the time zone configured by the Client is UTC + 0800, TIMETRUNCATE ('2020-01-01 23:00:00', 1d, 0) returns the result of '2020-01-01 08:00:00'.
When using TIMETRUNCATE ('2020-01-01 23:00:00', 1d, 1), the result is 2020-01-01 00:00:00 '.
When use_current_timezone is not specified, use_current_timezone defaults to 1.
- When truncating a time value to the week (1w), weeks are determined using the Unix epoch (1970-01-01T00:00:00Z UTC). The Unix epoch was on a Thursday, so all calculated weeks begin on Thursday.
#### TIMEZONE

View File

@ -656,7 +656,8 @@ use_current_timezone: {
例如客户端所配置时区为 UTC+0800, 则 TIMETRUNCATE('2020-01-01 23:00:00', 1d, 0) 返回结果为东八区时间 '2020-01-01 08:00:00'。
而使用 TIMETRUNCATE('2020-01-01 23:00:00', 1d, 1) 时,返回结果为东八区时间 '2020-01-01 00:00:00'。
当不指定 use_current_timezone 时use_current_timezone 默认值为 1 。
- 当将时间值截断到一周1wtimetruncate 的计算是基于 Unix 时间戳1970年1月1日00:00:00 UTC进行的。Unix 时间戳始于星期四,
因此所有截断后的日期都是星期四。
#### TIMEZONE