This is an automated email from the ASF dual-hosted git repository.
zclll 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 350eea596ad [doc](fix) Fix the unix_timestamp documention (#2677)
350eea596ad is described below
commit 350eea596ada17f768808c81e355924e21f683fe
Author: dwdwqfwe <[email protected]>
AuthorDate: Wed Jul 30 11:47:06 2025 +0800
[doc](fix) Fix the unix_timestamp documention (#2677)
## Versions
- [x] dev
- [x] 3.0
- [x] 2.1
- [ ] 2.0
## Languages
- [ ] Chinese
- [ ] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../date-time-functions/unix-timestamp.md | 21 +++++++++++++++++++++
.../date-time-functions/unix-timestamp.md | 21 +++++++++++++++++++++
.../date-time-functions/unix-timestamp.md | 21 +++++++++++++++++++++
.../date-time-functions/unix-timestamp.md | 21 +++++++++++++++++++++
.../date-time-functions/unix-timestamp.md | 21 +++++++++++++++++++++
.../date-time-functions/unix-timestamp.md | 21 +++++++++++++++++++++
6 files changed, 126 insertions(+)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
index a7a9f783d29..90d984ff8d3 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
@@ -11,6 +11,8 @@
`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+`DECIMAL UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+
Converting a Date or Datetime type to a UNIX timestamp.
If there are no parameters, the current time is converted into a timestamp.
@@ -23,6 +25,14 @@ See `date_format` function to get Format explanation.
This function is affected by time zone.
+
+## Return Value
+Returns two types based on the input:
+
+If the input `datetime` and non-zero scale
+Returns a timestamp of type Decimal, maximum six decimal places of precision
+If the input `datetime` and zeo scale
+Returns a timestamp of type `INT`.
### example
```
@@ -62,6 +72,17 @@ mysql> select unix_timestamp('1969-01-01 00:00:00');
+---------------------------------------+
```
+Input with non-zero scale
+
+```
+mysql> SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.123');
++-------------------------------------------+
+| UNIX_TIMESTAMP('2015-11-13 10:20:19.123') |
++-------------------------------------------+
+| 1447381219.123 |
++-------------------------------------------+
+```
+
### keywords
UNIX_TIMESTAMP,UNIX,TIMESTAMP
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
index c4a85dbf66e..25545628fc5 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
@@ -9,6 +9,8 @@
## 描述
## 语法
+`DECIMAL UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+
`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
将 Date 或者 Datetime 类型转化为 unix 时间戳。
@@ -23,6 +25,14 @@ Format 的格式请参阅 `date_format` 函数的格式说明。
该函数受时区影响。
+## 返回值
+根据输入返回两种类型
+1.若是输入的 datetime scale 不为0
+返回一个时间戳,类型为 Decimal,最高六位小数精度
+
+2.若是输入的 datetime scale 为0
+返回一个时间戳,类型为 INT
+
## 举例
```
@@ -62,6 +72,17 @@ mysql> select unix_timestamp('1969-01-01 00:00:00');
+---------------------------------------+
```
+输入时间并且 scale 不为0
+
+```
+mysql> SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.123');
++-------------------------------------------+
+| UNIX_TIMESTAMP('2015-11-13 10:20:19.123') |
++-------------------------------------------+
+| 1447381219.123 |
++-------------------------------------------+
+```
+
### keywords
UNIX_TIMESTAMP,UNIX,TIMESTAMP
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
index c4a85dbf66e..25545628fc5 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
@@ -9,6 +9,8 @@
## 描述
## 语法
+`DECIMAL UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+
`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
将 Date 或者 Datetime 类型转化为 unix 时间戳。
@@ -23,6 +25,14 @@ Format 的格式请参阅 `date_format` 函数的格式说明。
该函数受时区影响。
+## 返回值
+根据输入返回两种类型
+1.若是输入的 datetime scale 不为0
+返回一个时间戳,类型为 Decimal,最高六位小数精度
+
+2.若是输入的 datetime scale 为0
+返回一个时间戳,类型为 INT
+
## 举例
```
@@ -62,6 +72,17 @@ mysql> select unix_timestamp('1969-01-01 00:00:00');
+---------------------------------------+
```
+输入时间并且 scale 不为0
+
+```
+mysql> SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.123');
++-------------------------------------------+
+| UNIX_TIMESTAMP('2015-11-13 10:20:19.123') |
++-------------------------------------------+
+| 1447381219.123 |
++-------------------------------------------+
+```
+
### keywords
UNIX_TIMESTAMP,UNIX,TIMESTAMP
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
index c4a85dbf66e..25545628fc5 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
@@ -9,6 +9,8 @@
## 描述
## 语法
+`DECIMAL UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+
`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
将 Date 或者 Datetime 类型转化为 unix 时间戳。
@@ -23,6 +25,14 @@ Format 的格式请参阅 `date_format` 函数的格式说明。
该函数受时区影响。
+## 返回值
+根据输入返回两种类型
+1.若是输入的 datetime scale 不为0
+返回一个时间戳,类型为 Decimal,最高六位小数精度
+
+2.若是输入的 datetime scale 为0
+返回一个时间戳,类型为 INT
+
## 举例
```
@@ -62,6 +72,17 @@ mysql> select unix_timestamp('1969-01-01 00:00:00');
+---------------------------------------+
```
+输入时间并且 scale 不为0
+
+```
+mysql> SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.123');
++-------------------------------------------+
+| UNIX_TIMESTAMP('2015-11-13 10:20:19.123') |
++-------------------------------------------+
+| 1447381219.123 |
++-------------------------------------------+
+```
+
### keywords
UNIX_TIMESTAMP,UNIX,TIMESTAMP
diff --git
a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
index a7a9f783d29..90d984ff8d3 100644
---
a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
+++
b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
@@ -11,6 +11,8 @@
`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+`DECIMAL UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+
Converting a Date or Datetime type to a UNIX timestamp.
If there are no parameters, the current time is converted into a timestamp.
@@ -23,6 +25,14 @@ See `date_format` function to get Format explanation.
This function is affected by time zone.
+
+## Return Value
+Returns two types based on the input:
+
+If the input `datetime` and non-zero scale
+Returns a timestamp of type Decimal, maximum six decimal places of precision
+If the input `datetime` and zeo scale
+Returns a timestamp of type `INT`.
### example
```
@@ -62,6 +72,17 @@ mysql> select unix_timestamp('1969-01-01 00:00:00');
+---------------------------------------+
```
+Input with non-zero scale
+
+```
+mysql> SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.123');
++-------------------------------------------+
+| UNIX_TIMESTAMP('2015-11-13 10:20:19.123') |
++-------------------------------------------+
+| 1447381219.123 |
++-------------------------------------------+
+```
+
### keywords
UNIX_TIMESTAMP,UNIX,TIMESTAMP
diff --git
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
index a7a9f783d29..90d984ff8d3 100644
---
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
+++
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md
@@ -11,6 +11,8 @@
`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+`DECIMAL UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])`
+
Converting a Date or Datetime type to a UNIX timestamp.
If there are no parameters, the current time is converted into a timestamp.
@@ -23,6 +25,14 @@ See `date_format` function to get Format explanation.
This function is affected by time zone.
+
+## Return Value
+Returns two types based on the input:
+
+If the input `datetime` and non-zero scale
+Returns a timestamp of type Decimal, maximum six decimal places of precision
+If the input `datetime` and zeo scale
+Returns a timestamp of type `INT`.
### example
```
@@ -62,6 +72,17 @@ mysql> select unix_timestamp('1969-01-01 00:00:00');
+---------------------------------------+
```
+Input with non-zero scale
+
+```
+mysql> SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.123');
++-------------------------------------------+
+| UNIX_TIMESTAMP('2015-11-13 10:20:19.123') |
++-------------------------------------------+
+| 1447381219.123 |
++-------------------------------------------+
+```
+
### keywords
UNIX_TIMESTAMP,UNIX,TIMESTAMP
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]