This is an automated email from the ASF dual-hosted git repository.

kassiez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 9534d5e0265 [doc] Improve some datetime function desc (#2091)
9534d5e0265 is described below

commit 9534d5e0265142dd155a569c1e77d29871da071a
Author: mklzl <36362816+mk...@users.noreply.github.com>
AuthorDate: Wed Apr 23 17:15:34 2025 +0800

    [doc] Improve some datetime function desc (#2091)
    
    ## Versions
    
    - [x] dev
    - [x] 3.0
    - [x] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [x] Chinese
    - [x] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 .../date-time-functions/timestampadd.md            | 28 +++++++++++++++-----
 .../date-time-functions/timestampdiff.md           | 28 +++++++++++++++-----
 .../date-time-functions/timestampadd.md            | 26 ++++++++++++++-----
 .../date-time-functions/timestampdiff.md           | 23 +++++++++++++----
 .../date-time-functions/timestampadd.md            | 30 ++++++++++++++++------
 .../date-time-functions/timestampdiff.md           | 29 +++++++++++++++------
 .../date-time-functions/timestampadd.md            | 30 ++++++++++++++++------
 .../date-time-functions/timestampdiff.md           | 29 +++++++++++++++------
 .../date-time-functions/timestampadd.md            | 24 +++++++++++++----
 .../date-time-functions/timestampdiff.md           | 24 +++++++++++++----
 .../date-time-functions/timestampadd.md            | 28 +++++++++++++++-----
 .../date-time-functions/timestampdiff.md           | 28 +++++++++++++++-----
 12 files changed, 246 insertions(+), 81 deletions(-)

diff --git 
a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
 
b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
index 2c0c358c4f6..281d96df549 100644
--- 
a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
+++ 
b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPADD",
-    "language": "en"
+  "title": "TIMESTAMPADD",
+  "language": "en"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## Description
 
-The `timestampadd` function is used to add a specified time unit (such as 
year, month, day, hour, minute, second, etc.) to a timestamp or date. This 
function is commonly used for date and time calculations.
+The `timestampadd` function is used to add a specified time unit (such as 
year, month, day, hour, minute, second, etc.) to a date. This function is 
commonly used for date and time calculations.
 
 ## Syntax
 
@@ -34,16 +34,18 @@ The `timestampadd` function is used to add a specified time 
unit (such as year,
 
 ## Parameters
 
-| Parameter | Description |
-| -- | -- |
-| `unit` | Time unit, specifies the time unit to add, common values include 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
+| Parameter | Description                                                      
                                                    |
+| -- 
|----------------------------------------------------------------------------------------------------------------------|
+| `unit` | Time unit, specifies the time unit to add, common values include 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR        |
 | `interval` | The time interval to add, typically an integer, which can be 
positive or negative to add or subtract the time length |
-| `datetime_expr` | A valid target timestamp or date |
+| `datetime_expr` | A valid  datetime data type                                
                                                          |
 
 ## Return Value
 
 The return value is the new date and time, representing the result of adding 
or subtracting the specified time interval to the given timestamp.
 
+If the input parameters are invalid, `NULL` is returned.
+
 ## Examples
 
 ```sql
@@ -69,3 +71,15 @@ SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
 | 2019-01-09 00:00:00                          |
 +----------------------------------------------+
 ```
+
+```sql
+SELECT TIMESTAMPADD(WEEK,1,'1196440219');
+```
+
+```sql
++------------------------------------------------------------+
+| timestampadd(WEEK, 1, CAST('1196440219' AS datetimev2(6))) |
++------------------------------------------------------------+
+| NULL                                                       |
++------------------------------------------------------------+
+```
diff --git 
a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
 
b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
index bbabb256ae6..88341962fe5 100644
--- 
a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
+++ 
b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPDIFF",
-    "language": "en"
+  "title": "TIMESTAMPDIFF",
+  "language": "en"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## Description
 
-The `timestampdiff` function is used to calculate the difference between two 
timestamps or dates and returns the time interval between them. The difference 
can be returned in the specified time unit (such as seconds, minutes, hours, 
days, months, years, etc.).
+The `timestampdiff` function is used to calculate the difference between two  
dates and returns the time interval between them. The difference can be 
returned in the specified time unit (such as seconds, minutes, hours, days, 
months, years, etc.).
 
 ## Syntax
 
@@ -34,16 +34,18 @@ The `timestampdiff` function is used to calculate the 
difference between two tim
 
 ## Parameters
 
-| Parameter | Description |
-| -- | -- |
+| Parameter | Description                                                      
                                                            |
+| -- 
|------------------------------------------------------------------------------------------------------------------------------|
 | `unit` | Time unit, specifies the unit in which to return the difference, 
common values include SECOND, MINUTE, HOUR, DAY, MONTH, YEAR |
-| `datetime_expr1` | The first datetime, a valid target timestamp or date |
-| `datetime_expr2` | The second datetime, a valid target timestamp or date |
+| `datetime_expr1` | The first datetime, a valid target  date                  
                                                                   |
+| `datetime_expr2` | The second datetime, a valid target  date                 
                                                       |
 
 ## Return Value
 
 The return value is the difference between the two date-times, with the unit 
determined by the unit parameter.
 
+If the input parameters are invalid, `NULL` is returned.
+
 ## Examples
 
 ```sql
@@ -80,4 +82,16 @@ SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 
12:05:55');
 +---------------------------------------------------------------------+
 |                                                              128885 |
 +---------------------------------------------------------------------+
+```
+
+```sql
+SELECT  TIMESTAMPDIFF(MINUTE,'2003-02-01','1196440219');
+```
+
+```text
++-----------------------------------------------------------------------------------+
+| timestampdiff(MINUTE, '2003-02-01 00:00:00', CAST('1196440219' AS 
datetimev2(6))) |
++-----------------------------------------------------------------------------------+
+|                                                                              
NULL |
++-----------------------------------------------------------------------------------+
 ```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
index ab2c2805e75..a09187a3b24 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
@@ -26,7 +26,7 @@ under the License.
 
 ## 描述
 
-`timestampadd`  函数用于将指定的时间单位(如年、月、日、小时、分钟、秒等)添加到一个时间戳或日期上。这个函数通常用于日期和时间的计算。
+`timestampadd`  函数用于将指定的时间单位(如年、月、日、小时、分钟、秒等)添加到一个日期上。这个函数通常用于日期和时间的计算。
 
 ## 语法
 
@@ -34,16 +34,18 @@ under the License.
 
 ## 参数
 
-| 参数 | 说明 |
-| -- | -- |
-| `unit` | 时间单位,指定要添加的时间单位,常见的值有 SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR|
-|`interval`| 要添加的时间间隔,通常是一个整数,可以是正数或负数,表示添加或减去的时间长度 |
-| `datetime_expr` | 合法的目标时间戳或日期 |
+| 参数 | 说明                                                                |
+| -- |-------------------------------------------------------------------|
+| `unit` | 时间单位,指定要添加的时间单位,常见的值有 SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
+|`interval`| 要添加的时间间隔,通常是一个整数,可以是正数或负数,表示添加或减去的时间长度                            
|
+| `datetime_expr` | 合法的目标日期,为 `DATETIME` 类型                                    
         |
 
 ## 返回值
 
 返回新的日期时间,表示在指定时间点上添加或减去指定时间间隔后的结果。
 
+如果输入的目标日期不合法,则返回 `NULL`。
+
 ## 举例
 
 ```sql
@@ -69,3 +71,15 @@ SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
 | 2019-01-09 00:00:00                          |
 +----------------------------------------------+
 ```
+
+```sql
+SELECT TIMESTAMPADD(WEEK,1,'1196440219');
+```
+
+```sql
++------------------------------------------------------------+
+| timestampadd(WEEK, 1, CAST('1196440219' AS datetimev2(6))) |
++------------------------------------------------------------+
+| NULL                                                       |
++------------------------------------------------------------+
+```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
index fce955d9917..bfc0e045ef7 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
@@ -26,7 +26,7 @@ under the License.
 
 ## 描述
 
-`timestampdiff` 
函数用于计算两个时间戳或日期之间的差值,返回两个时间戳之间的时间间隔。可以计算两者之间的差异,以指定的时间单位(如秒、分钟、小时、天、月、年等)返回结果。
+`timestampdiff` 
函数用于计算两个日期之间的差值,返回两个日期之间的时间间隔。可以计算两者之间的差异,以指定的时间单位(如秒、分钟、小时、天、月、年等)返回结果。
 
 ## 语法
 
@@ -34,16 +34,18 @@ under the License.
 
 ## 参数
 
-| 参数 | 说明 |
-| -- | -- |
+| 参数 | 说明                                                        |
+| -- |-----------------------------------------------------------|
 | `unit` | 时间单位,指定要返回差异的单位,常见的值有 SECOND、MINUTE、HOUR、DAY、MONTH、YEAR 等 |
-|`datetime_expr1`| 第一个日期时间,合法的目标时间戳或日期 |
-|`datetime_expr2`| 第二个日期时间,合法的目标时间戳或日期 |
+|`datetime_expr1`| 第一个日期时间,合法的日期格式                                           |
+|`datetime_expr2`| 第二个日期时间,合法的日期格式                                           |
 
 ## 返回值
 
  返回两个日期时间之间的差异,单位根据 unit 参数确定。
 
+ 如果输入的参数不合法,则返回 `NULL`
+
 ## 举例
 
 ```sql
@@ -81,3 +83,14 @@ SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 
12:05:55');
 |                                                              128885 |
 +---------------------------------------------------------------------+
 ```
+```sql
+SELECT  TIMESTAMPDIFF(MINUTE,'2003-02-01','1196440219');
+```
+
+```text
++-----------------------------------------------------------------------------------+
+| timestampdiff(MINUTE, '2003-02-01 00:00:00', CAST('1196440219' AS 
datetimev2(6))) |
++-----------------------------------------------------------------------------------+
+|                                                                              
NULL |
++-----------------------------------------------------------------------------------+
+```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
index ab2c2805e75..e087ba394bb 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPADD",
-    "language": "zh-CN"
+  "title": "TIMESTAMPADD",
+  "language": "zh-CN"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## 描述
 
-`timestampadd`  函数用于将指定的时间单位(如年、月、日、小时、分钟、秒等)添加到一个时间戳或日期上。这个函数通常用于日期和时间的计算。
+`timestampadd`  函数用于将指定的时间单位(如年、月、日、小时、分钟、秒等)添加到一个日期上。这个函数通常用于日期和时间的计算。
 
 ## 语法
 
@@ -34,16 +34,18 @@ under the License.
 
 ## 参数
 
-| 参数 | 说明 |
-| -- | -- |
-| `unit` | 时间单位,指定要添加的时间单位,常见的值有 SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR|
-|`interval`| 要添加的时间间隔,通常是一个整数,可以是正数或负数,表示添加或减去的时间长度 |
-| `datetime_expr` | 合法的目标时间戳或日期 |
+| 参数 | 说明                                                                |
+| -- |-------------------------------------------------------------------|
+| `unit` | 时间单位,指定要添加的时间单位,常见的值有 SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
+|`interval`| 要添加的时间间隔,通常是一个整数,可以是正数或负数,表示添加或减去的时间长度                            
|
+| `datetime_expr` | 合法的目标日期,为 `DATETIME` 类型                                    
         |
 
 ## 返回值
 
 返回新的日期时间,表示在指定时间点上添加或减去指定时间间隔后的结果。
 
+如果输入的目标日期不合法,则返回 `NULL`。
+
 ## 举例
 
 ```sql
@@ -69,3 +71,15 @@ SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
 | 2019-01-09 00:00:00                          |
 +----------------------------------------------+
 ```
+
+```sql
+SELECT TIMESTAMPADD(WEEK,1,'1196440219');
+```
+
+```sql
++------------------------------------------------------------+
+| timestampadd(WEEK, 1, CAST('1196440219' AS datetimev2(6))) |
++------------------------------------------------------------+
+| NULL                                                       |
++------------------------------------------------------------+
+```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
index fce955d9917..a113ab75488 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPDIFF",
-    "language": "zh-CN"
+  "title": "TIMESTAMPDIFF",
+  "language": "zh-CN"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## 描述
 
-`timestampdiff` 
函数用于计算两个时间戳或日期之间的差值,返回两个时间戳之间的时间间隔。可以计算两者之间的差异,以指定的时间单位(如秒、分钟、小时、天、月、年等)返回结果。
+`timestampdiff` 
函数用于计算两个日期之间的差值,返回两个日期之间的时间间隔。可以计算两者之间的差异,以指定的时间单位(如秒、分钟、小时、天、月、年等)返回结果。
 
 ## 语法
 
@@ -34,15 +34,17 @@ under the License.
 
 ## 参数
 
-| 参数 | 说明 |
-| -- | -- |
+| 参数 | 说明                                                        |
+| -- |-----------------------------------------------------------|
 | `unit` | 时间单位,指定要返回差异的单位,常见的值有 SECOND、MINUTE、HOUR、DAY、MONTH、YEAR 等 |
-|`datetime_expr1`| 第一个日期时间,合法的目标时间戳或日期 |
-|`datetime_expr2`| 第二个日期时间,合法的目标时间戳或日期 |
+|`datetime_expr1`| 第一个日期时间,合法的日期格式                                           |
+|`datetime_expr2`| 第二个日期时间,合法的日期格式                                           |
 
 ## 返回值
 
- 返回两个日期时间之间的差异,单位根据 unit 参数确定。
+返回两个日期时间之间的差异,单位根据 unit 参数确定。
+
+如果输入的参数不合法,则返回 `NULL`
 
 ## 举例
 
@@ -81,3 +83,14 @@ SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 
12:05:55');
 |                                                              128885 |
 +---------------------------------------------------------------------+
 ```
+```sql
+SELECT  TIMESTAMPDIFF(MINUTE,'2003-02-01','1196440219');
+```
+
+```text
++-----------------------------------------------------------------------------------+
+| timestampdiff(MINUTE, '2003-02-01 00:00:00', CAST('1196440219' AS 
datetimev2(6))) |
++-----------------------------------------------------------------------------------+
+|                                                                              
NULL |
++-----------------------------------------------------------------------------------+
+```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
index ab2c2805e75..e087ba394bb 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPADD",
-    "language": "zh-CN"
+  "title": "TIMESTAMPADD",
+  "language": "zh-CN"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## 描述
 
-`timestampadd`  函数用于将指定的时间单位(如年、月、日、小时、分钟、秒等)添加到一个时间戳或日期上。这个函数通常用于日期和时间的计算。
+`timestampadd`  函数用于将指定的时间单位(如年、月、日、小时、分钟、秒等)添加到一个日期上。这个函数通常用于日期和时间的计算。
 
 ## 语法
 
@@ -34,16 +34,18 @@ under the License.
 
 ## 参数
 
-| 参数 | 说明 |
-| -- | -- |
-| `unit` | 时间单位,指定要添加的时间单位,常见的值有 SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR|
-|`interval`| 要添加的时间间隔,通常是一个整数,可以是正数或负数,表示添加或减去的时间长度 |
-| `datetime_expr` | 合法的目标时间戳或日期 |
+| 参数 | 说明                                                                |
+| -- |-------------------------------------------------------------------|
+| `unit` | 时间单位,指定要添加的时间单位,常见的值有 SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
+|`interval`| 要添加的时间间隔,通常是一个整数,可以是正数或负数,表示添加或减去的时间长度                            
|
+| `datetime_expr` | 合法的目标日期,为 `DATETIME` 类型                                    
         |
 
 ## 返回值
 
 返回新的日期时间,表示在指定时间点上添加或减去指定时间间隔后的结果。
 
+如果输入的目标日期不合法,则返回 `NULL`。
+
 ## 举例
 
 ```sql
@@ -69,3 +71,15 @@ SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
 | 2019-01-09 00:00:00                          |
 +----------------------------------------------+
 ```
+
+```sql
+SELECT TIMESTAMPADD(WEEK,1,'1196440219');
+```
+
+```sql
++------------------------------------------------------------+
+| timestampadd(WEEK, 1, CAST('1196440219' AS datetimev2(6))) |
++------------------------------------------------------------+
+| NULL                                                       |
++------------------------------------------------------------+
+```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
index fce955d9917..a113ab75488 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPDIFF",
-    "language": "zh-CN"
+  "title": "TIMESTAMPDIFF",
+  "language": "zh-CN"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## 描述
 
-`timestampdiff` 
函数用于计算两个时间戳或日期之间的差值,返回两个时间戳之间的时间间隔。可以计算两者之间的差异,以指定的时间单位(如秒、分钟、小时、天、月、年等)返回结果。
+`timestampdiff` 
函数用于计算两个日期之间的差值,返回两个日期之间的时间间隔。可以计算两者之间的差异,以指定的时间单位(如秒、分钟、小时、天、月、年等)返回结果。
 
 ## 语法
 
@@ -34,15 +34,17 @@ under the License.
 
 ## 参数
 
-| 参数 | 说明 |
-| -- | -- |
+| 参数 | 说明                                                        |
+| -- |-----------------------------------------------------------|
 | `unit` | 时间单位,指定要返回差异的单位,常见的值有 SECOND、MINUTE、HOUR、DAY、MONTH、YEAR 等 |
-|`datetime_expr1`| 第一个日期时间,合法的目标时间戳或日期 |
-|`datetime_expr2`| 第二个日期时间,合法的目标时间戳或日期 |
+|`datetime_expr1`| 第一个日期时间,合法的日期格式                                           |
+|`datetime_expr2`| 第二个日期时间,合法的日期格式                                           |
 
 ## 返回值
 
- 返回两个日期时间之间的差异,单位根据 unit 参数确定。
+返回两个日期时间之间的差异,单位根据 unit 参数确定。
+
+如果输入的参数不合法,则返回 `NULL`
 
 ## 举例
 
@@ -81,3 +83,14 @@ SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 
12:05:55');
 |                                                              128885 |
 +---------------------------------------------------------------------+
 ```
+```sql
+SELECT  TIMESTAMPDIFF(MINUTE,'2003-02-01','1196440219');
+```
+
+```text
++-----------------------------------------------------------------------------------+
+| timestampdiff(MINUTE, '2003-02-01 00:00:00', CAST('1196440219' AS 
datetimev2(6))) |
++-----------------------------------------------------------------------------------+
+|                                                                              
NULL |
++-----------------------------------------------------------------------------------+
+```
\ No newline at end of file
diff --git 
a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
 
b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
index 2c0c358c4f6..7856053b0ce 100644
--- 
a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
+++ 
b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
@@ -26,7 +26,7 @@ under the License.
 
 ## Description
 
-The `timestampadd` function is used to add a specified time unit (such as 
year, month, day, hour, minute, second, etc.) to a timestamp or date. This 
function is commonly used for date and time calculations.
+The `timestampadd` function is used to add a specified time unit (such as 
year, month, day, hour, minute, second, etc.) to a date. This function is 
commonly used for date and time calculations.
 
 ## Syntax
 
@@ -34,16 +34,18 @@ The `timestampadd` function is used to add a specified time 
unit (such as year,
 
 ## Parameters
 
-| Parameter | Description |
-| -- | -- |
-| `unit` | Time unit, specifies the time unit to add, common values include 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
+| Parameter | Description                                                      
                                                    |
+| -- 
|----------------------------------------------------------------------------------------------------------------------|
+| `unit` | Time unit, specifies the time unit to add, common values include 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR        |
 | `interval` | The time interval to add, typically an integer, which can be 
positive or negative to add or subtract the time length |
-| `datetime_expr` | A valid target timestamp or date |
+| `datetime_expr` | A valid  datetime data type                                
                                                          |
 
 ## Return Value
 
 The return value is the new date and time, representing the result of adding 
or subtracting the specified time interval to the given timestamp.
 
+If the input parameters are invalid, `NULL` is returned.
+
 ## Examples
 
 ```sql
@@ -69,3 +71,15 @@ SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
 | 2019-01-09 00:00:00                          |
 +----------------------------------------------+
 ```
+
+```sql
+SELECT TIMESTAMPADD(WEEK,1,'1196440219');
+```
+
+```sql
++------------------------------------------------------------+
+| timestampadd(WEEK, 1, CAST('1196440219' AS datetimev2(6))) |
++------------------------------------------------------------+
+| NULL                                                       |
++------------------------------------------------------------+
+```
diff --git 
a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
 
b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
index bbabb256ae6..047df6c5625 100644
--- 
a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
+++ 
b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
@@ -26,7 +26,7 @@ under the License.
 
 ## Description
 
-The `timestampdiff` function is used to calculate the difference between two 
timestamps or dates and returns the time interval between them. The difference 
can be returned in the specified time unit (such as seconds, minutes, hours, 
days, months, years, etc.).
+The `timestampdiff` function is used to calculate the difference between two  
dates and returns the time interval between them. The difference can be 
returned in the specified time unit (such as seconds, minutes, hours, days, 
months, years, etc.).
 
 ## Syntax
 
@@ -34,16 +34,18 @@ The `timestampdiff` function is used to calculate the 
difference between two tim
 
 ## Parameters
 
-| Parameter | Description |
-| -- | -- |
+| Parameter | Description                                                      
                                                            |
+| -- 
|------------------------------------------------------------------------------------------------------------------------------|
 | `unit` | Time unit, specifies the unit in which to return the difference, 
common values include SECOND, MINUTE, HOUR, DAY, MONTH, YEAR |
-| `datetime_expr1` | The first datetime, a valid target timestamp or date |
-| `datetime_expr2` | The second datetime, a valid target timestamp or date |
+| `datetime_expr1` | The first datetime, a valid target  date                  
                                                                   |
+| `datetime_expr2` | The second datetime, a valid target  date                 
                                                       |
 
 ## Return Value
 
 The return value is the difference between the two date-times, with the unit 
determined by the unit parameter.
 
+If the input parameters are invalid, `NULL` is returned.
+
 ## Examples
 
 ```sql
@@ -80,4 +82,16 @@ SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 
12:05:55');
 +---------------------------------------------------------------------+
 |                                                              128885 |
 +---------------------------------------------------------------------+
+```
+
+```sql
+SELECT  TIMESTAMPDIFF(MINUTE,'2003-02-01','1196440219');
+```
+
+```text
++-----------------------------------------------------------------------------------+
+| timestampdiff(MINUTE, '2003-02-01 00:00:00', CAST('1196440219' AS 
datetimev2(6))) |
++-----------------------------------------------------------------------------------+
+|                                                                              
NULL |
++-----------------------------------------------------------------------------------+
 ```
\ No newline at end of file
diff --git 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
index 2c0c358c4f6..281d96df549 100644
--- 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
+++ 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampadd.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPADD",
-    "language": "en"
+  "title": "TIMESTAMPADD",
+  "language": "en"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## Description
 
-The `timestampadd` function is used to add a specified time unit (such as 
year, month, day, hour, minute, second, etc.) to a timestamp or date. This 
function is commonly used for date and time calculations.
+The `timestampadd` function is used to add a specified time unit (such as 
year, month, day, hour, minute, second, etc.) to a date. This function is 
commonly used for date and time calculations.
 
 ## Syntax
 
@@ -34,16 +34,18 @@ The `timestampadd` function is used to add a specified time 
unit (such as year,
 
 ## Parameters
 
-| Parameter | Description |
-| -- | -- |
-| `unit` | Time unit, specifies the time unit to add, common values include 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
+| Parameter | Description                                                      
                                                    |
+| -- 
|----------------------------------------------------------------------------------------------------------------------|
+| `unit` | Time unit, specifies the time unit to add, common values include 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR        |
 | `interval` | The time interval to add, typically an integer, which can be 
positive or negative to add or subtract the time length |
-| `datetime_expr` | A valid target timestamp or date |
+| `datetime_expr` | A valid  datetime data type                                
                                                          |
 
 ## Return Value
 
 The return value is the new date and time, representing the result of adding 
or subtracting the specified time interval to the given timestamp.
 
+If the input parameters are invalid, `NULL` is returned.
+
 ## Examples
 
 ```sql
@@ -69,3 +71,15 @@ SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
 | 2019-01-09 00:00:00                          |
 +----------------------------------------------+
 ```
+
+```sql
+SELECT TIMESTAMPADD(WEEK,1,'1196440219');
+```
+
+```sql
++------------------------------------------------------------+
+| timestampadd(WEEK, 1, CAST('1196440219' AS datetimev2(6))) |
++------------------------------------------------------------+
+| NULL                                                       |
++------------------------------------------------------------+
+```
diff --git 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
index bbabb256ae6..88341962fe5 100644
--- 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
+++ 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/timestampdiff.md
@@ -1,7 +1,7 @@
 ---
 {
-    "title": "TIMESTAMPDIFF",
-    "language": "en"
+  "title": "TIMESTAMPDIFF",
+  "language": "en"
 }
 ---
 
@@ -26,7 +26,7 @@ under the License.
 
 ## Description
 
-The `timestampdiff` function is used to calculate the difference between two 
timestamps or dates and returns the time interval between them. The difference 
can be returned in the specified time unit (such as seconds, minutes, hours, 
days, months, years, etc.).
+The `timestampdiff` function is used to calculate the difference between two  
dates and returns the time interval between them. The difference can be 
returned in the specified time unit (such as seconds, minutes, hours, days, 
months, years, etc.).
 
 ## Syntax
 
@@ -34,16 +34,18 @@ The `timestampdiff` function is used to calculate the 
difference between two tim
 
 ## Parameters
 
-| Parameter | Description |
-| -- | -- |
+| Parameter | Description                                                      
                                                            |
+| -- 
|------------------------------------------------------------------------------------------------------------------------------|
 | `unit` | Time unit, specifies the unit in which to return the difference, 
common values include SECOND, MINUTE, HOUR, DAY, MONTH, YEAR |
-| `datetime_expr1` | The first datetime, a valid target timestamp or date |
-| `datetime_expr2` | The second datetime, a valid target timestamp or date |
+| `datetime_expr1` | The first datetime, a valid target  date                  
                                                                   |
+| `datetime_expr2` | The second datetime, a valid target  date                 
                                                       |
 
 ## Return Value
 
 The return value is the difference between the two date-times, with the unit 
determined by the unit parameter.
 
+If the input parameters are invalid, `NULL` is returned.
+
 ## Examples
 
 ```sql
@@ -80,4 +82,16 @@ SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 
12:05:55');
 +---------------------------------------------------------------------+
 |                                                              128885 |
 +---------------------------------------------------------------------+
+```
+
+```sql
+SELECT  TIMESTAMPDIFF(MINUTE,'2003-02-01','1196440219');
+```
+
+```text
++-----------------------------------------------------------------------------------+
+| timestampdiff(MINUTE, '2003-02-01 00:00:00', CAST('1196440219' AS 
datetimev2(6))) |
++-----------------------------------------------------------------------------------+
+|                                                                              
NULL |
++-----------------------------------------------------------------------------------+
 ```
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org


Reply via email to