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 bdcb693043c [Fix](function) Fix wrong English and Inaccurate Chinese doc of function date_format (#2182) bdcb693043c is described below commit bdcb693043c74209a501e4c601dbd36669c006ae Author: zclllyybb <zhaochan...@selectdb.com> AuthorDate: Thu Mar 13 11:59:57 2025 +0800 [Fix](function) Fix wrong English and Inaccurate Chinese doc of function date_format (#2182) ## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [x] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built --- .../date-time-functions/date-format.md | 70 ++++++++-------- .../date-time-functions/date-format.md | 28 ++++--- .../date-time-functions/date-format.md | 98 ++++++++-------------- .../date-time-functions/date-format.md | 20 +++-- .../date-time-functions/date-format.md | 20 +++-- .../date-time-functions/date-format.md | 98 ++++++++-------------- .../date-time-functions/date-format.md | 70 ++++++++-------- .../date-time-functions/date-format.md | 70 ++++++++-------- 8 files changed, 215 insertions(+), 259 deletions(-) diff --git a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md index 062723521ab..48593af61ae 100644 --- a/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md +++ b/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md @@ -41,45 +41,46 @@ DATE_FORMAT(<date>, <format>) | `<date>` | A valid date value | | `<format>` | Specifies the output format for the date/time | - The formats available are: | Format | Description | |---------|----------------------------------------------------------------------| -| %a | Abbreviation for Sunday Name | -| %b | Abbreviated Monthly Name | -| %c | Month, numerical value | -| %D | Sky in the Moon with English Prefix | -| %d | Monthly day, numerical value (00-31) | -| %e | Monthly day, numerical value (0-31) | -| %f | Microseconds | -| %H | Hours (00-23) | -| %h | Hour (01-12) | -| %I | Hours (01-12) | -| %i | Minutes, numerical value (00-59) | -| %j | Days of Year (001-366) | -| %k | Hours (0-23) | -| %l | Hours (1-12) | -| %M | Moon Name | -| %m | Month, numerical value (00-12) | -| %p | AM or PM | -| %r | Time, 12-hour (hh:mm:ss AM or PM) | -| %S | Seconds (00-59) | -| %s | Seconds (00-59) | -| %T | Time, 24-hour (hh:mm:ss) | -| %U | Week (00-53) Sunday is the first day of the week | -| %u | Week (00-53) Monday is the first day of the week | -| %V | Week (01-53) Sunday is the first day of the week, and %X is used | -| %v | Week (01-53) Monday is the first day of the week, and %x is used | -| %W | Sunday | -| %w | Weekly day (0 = Sunday, 6 = Saturday) | -| %X | Year, where Sunday is the first day of the week, 4 digits, and %V used| -| %x | Year, where Monday is the first day of the week, 4 digits, and %V used| -| %Y | Year, 4 digits | -| %y | Year, 2 digits | -| %% | Represent % | +| %a | Abbreviated weekday name (Sun..Sat) | +| %b | Abbreviated month name (Jan..Dec) | +| %c | Month, numeric (0..12) | +| %D | Day of the month with English suffix (0th, 1st, 2nd, 3rd, …) | +| %d | Day of the month, numeric (00..31) | +| %e | Day of the month, numeric (0..31) | +| %f | Microseconds (000000..999999) | +| %H | Hour (00..23) | +| %h | Hour (01..12) | +| %I | Hour (01..12) | +| %i | Minutes, numeric (00..59) | +| %j | Day of year (001..366) | +| %k | Hour (0..23) | +| %l | Hour (1..12) | +| %M | Month name (January..December) | +| %m | Month, numeric (00..12) | +| %p | AM or PM | +| %r | Time, 12-hour (hh:mm:ss followed by AM or PM) | +| %S | Seconds (00..59) | +| %s | Seconds (00..59) | +| %T | Time, 24-hour (hh:mm:ss) | +| %U | Week (00..53), where Sunday is the first day of the week; [WEEK](./week) mode 0 | +| %u | Week (00..53), where Monday is the first day of the week; [WEEK](./week) mode 1 | +| %V | Week (01..53), where Sunday is the first day of the week; [WEEK](./week) mode 2; used with %X | +| %v | Week (01..53), where Monday is the first day of the week; [WEEK](./week) mode 3; used with %x | +| %W | Weekday name (Sunday..Saturday) | +| %w | Day of the week (0=Sunday..6=Saturday) | +| %X | Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V | +| %x | Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v | +| %Y | Year, numeric, four digits | +| %y | Year, numeric (two digits) | +| %% | A literal % character | +| %**x** | **x**, for any “**x**” not listed above | Also support 3 formats: + ```text yyyyMMdd yyyy-MM-dd @@ -89,6 +90,7 @@ yyyy-MM-dd HH:mm:ss ## Return Value The formatted date string, with the following special case: + - Currently, a maximum of 128 bytes of string is supported. If the returned value exceeds 128 bytes, it will return NULL. ## Examples @@ -175,4 +177,4 @@ select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ | %01 | +--------------------------------------------+ -``` \ 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/date-format.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md index 4f7eb4510cc..f33ee21d77c 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md @@ -41,18 +41,17 @@ DATE_FORMAT(<date>, <format>) | `<date>` | 合法的日期值 | | `<format>` | 规定日期/时间的输出格式 | - 支持的 format 格式: | 格式符 | 描述 | |--------|-------------------------------------| -| %a | 缩写星期名 | -| %b | 缩写月名 | -| %c | 月,数值 | -| %D | 带有英文前缀的月中的天 | +| %a | 三字母缩写星期名 | +| %b | 三字母缩写月名 | +| %c | 月,数值 (0-12) | +| %D | 带有英文后缀的月中的天 (0th, 1st, 2nd, 3rd, …) | | %d | 月的天,数值 (00-31) | | %e | 月的天,数值 (0-31) | -| %f | 微秒 | +| %f | 微秒 (000000-999999) | | %H | 小时 (00-23) | | %h | 小时 (01-12) | | %I | 小时 (01-12) | @@ -63,23 +62,25 @@ DATE_FORMAT(<date>, <format>) | %M | 月名 | | %m | 月,数值 (00-12) | | %p | AM 或 PM | -| %r | 时间,12-小时(hh:mm:ss AM 或 PM) | +| %r | 时间,12-小时(hh:mm:ss, 后跟 AM 或 PM) | | %S | 秒 (00-59) | | %s | 秒 (00-59) | | %T | 时间,24-小时 (hh:mm:ss) | -| %U | 周 (00-53) 星期日是一周的第一天 | -| %u | 周 (00-53) 星期一是一周的第一天 | -| %V | 周 (01-53) 星期日是一周的第一天,与 %X 使用 | -| %v | 周 (01-53) 星期一是一周的第一天,与 %x 使用 | -| %W | 星期名 | +| %U | 周 (00-53) 星期日是一周的第一天。[WEEK](./week) 模式0 | +| %u | 周 (00-53) 星期一是一周的第一天。[WEEK](./week) 模式1 | +| %V | 周 (01-53) 星期日是一周的第一天。[WEEK](./week) 模式2,与 %X 使用 | +| %v | 周 (01-53) 星期一是一周的第一天。[WEEK](./week) 模式3,与 %x 使用 | +| %W | 周中日的名称 (Sunday-Saturday) | | %w | 周的天(0=星期日,6=星期六) | | %X | 年,其中的星期日是周的第一天,4 位,与 %V 使用 | | %x | 年,其中的星期一是周的第一天,4 位,与 %v 使用 | | %Y | 年,4 位 | | %y | 年,2 位 | | %% | 用于表示 % | +| %**x** | 对于任何未出现在上列的 **x**,表示 **x** 本身 | 还可以使用三种特殊格式: + ```text yyyyMMdd yyyy-MM-dd @@ -89,6 +90,7 @@ yyyy-MM-dd HH:mm:ss ## 返回值 格式化后的日期字符串,特殊情况: + - 当前支持最大 128 字节的字符串,如果返回值长度超过 128,则返回 NULL。 ## 举例 @@ -175,4 +177,4 @@ select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ | %01 | +--------------------------------------------+ -``` \ No newline at end of file +``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md index 9810bbc0489..10e84149200 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md @@ -38,69 +38,41 @@ date 参数是合法的日期。format 规定日期/时间的输出格式。 可以使用的格式有: -%a | 缩写星期名 - -%b | 缩写月名 - -%c | 月,数值 - -%D | 带有英文前缀的月中的天 - -%d | 月的天,数值(00-31) - -%e | 月的天,数值(0-31) - -%f | 微秒 - -%H | 小时 (00-23) - -%h | 小时 (01-12) - -%I | 小时 (01-12) - -%i | 分钟,数值(00-59) - -%j | 年的天 (001-366) - -%k | 小时 (0-23) - -%l | 小时 (1-12) - -%M | 月名 - -%m | 月,数值(00-12) - -%p | AM 或 PM,仅在采用12小时制时可用。 - -%r | 时间,12-小时(hh:mm:ss),可以包含或不包含AM/PM。 - -%S | 秒(00-59) - -%s | 秒(00-59) - -%T | 时间, 24-小时 (hh:mm:ss) - -%U | 周 (00-53) 星期日是一周的第一天 - -%u | 周 (00-53) 星期一是一周的第一天 - -%V | 周 (01-53) 星期日是一周的第一天,与 %X 使用 - -%v | 周 (01-53) 星期一是一周的第一天,与 %x 使用 - -%W | 星期名 - -%w | 周的天 (0=星期日, 6=星期六) - -%X | 年,其中的星期日是周的第一天,4 位,与 %V 使用 - -%x | 年,其中的星期一是周的第一天,4 位,与 %v 使用 - -%Y | 年,4 位 - -%y | 年,2 位 - -%% | 用于表示 % +| 格式符 | 描述 | +|--------|-------------------------------------| +| %a | 三字母缩写星期名 | +| %b | 三字母缩写月名 | +| %c | 月,数值 (0-12) | +| %D | 带有英文后缀的月中的天 (0th, 1st, 2nd, 3rd, …) | +| %d | 月的天,数值 (00-31) | +| %e | 月的天,数值 (0-31) | +| %f | 微秒 (000000-999999) | +| %H | 小时 (00-23) | +| %h | 小时 (01-12) | +| %I | 小时 (01-12) | +| %i | 分钟,数值 (00-59) | +| %j | 年的天 (001-366) | +| %k | 小时 (0-23) | +| %l | 小时 (1-12) | +| %M | 月名 | +| %m | 月,数值 (00-12) | +| %p | AM 或 PM | +| %r | 时间,12-小时(hh:mm:ss, 后跟 AM 或 PM) | +| %S | 秒 (00-59) | +| %s | 秒 (00-59) | +| %T | 时间,24-小时 (hh:mm:ss) | +| %U | 周 (00-53) 星期日是一周的第一天 | +| %u | 周 (00-53) 星期一是一周的第一天 | +| %V | 周 (01-53) 星期日是一周的第一天,与 %X 使用 | +| %v | 周 (01-53) 星期一是一周的第一天,与 %x 使用 | +| %W | 周中日的名称 (Sunday-Saturday) | +| %w | 周的天(0=星期日,6=星期六) | +| %X | 年,其中的星期日是周的第一天,4 位,与 %V 使用 | +| %x | 年,其中的星期一是周的第一天,4 位,与 %v 使用 | +| %Y | 年,4 位 | +| %y | 年,2 位 | +| %% | 用于表示 % | +| %**x** | 对于任何未出现在上列的 **x**,表示 **x** 本身 | 还可以使用三种特殊格式: diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md index 4f7eb4510cc..d7281bc1d48 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md @@ -41,18 +41,17 @@ DATE_FORMAT(<date>, <format>) | `<date>` | 合法的日期值 | | `<format>` | 规定日期/时间的输出格式 | - 支持的 format 格式: | 格式符 | 描述 | |--------|-------------------------------------| -| %a | 缩写星期名 | -| %b | 缩写月名 | -| %c | 月,数值 | -| %D | 带有英文前缀的月中的天 | +| %a | 三字母缩写星期名 | +| %b | 三字母缩写月名 | +| %c | 月,数值 (0-12) | +| %D | 带有英文后缀的月中的天 (0th, 1st, 2nd, 3rd, …) | | %d | 月的天,数值 (00-31) | | %e | 月的天,数值 (0-31) | -| %f | 微秒 | +| %f | 微秒 (000000-999999) | | %H | 小时 (00-23) | | %h | 小时 (01-12) | | %I | 小时 (01-12) | @@ -63,7 +62,7 @@ DATE_FORMAT(<date>, <format>) | %M | 月名 | | %m | 月,数值 (00-12) | | %p | AM 或 PM | -| %r | 时间,12-小时(hh:mm:ss AM 或 PM) | +| %r | 时间,12-小时(hh:mm:ss, 后跟 AM 或 PM) | | %S | 秒 (00-59) | | %s | 秒 (00-59) | | %T | 时间,24-小时 (hh:mm:ss) | @@ -71,15 +70,17 @@ DATE_FORMAT(<date>, <format>) | %u | 周 (00-53) 星期一是一周的第一天 | | %V | 周 (01-53) 星期日是一周的第一天,与 %X 使用 | | %v | 周 (01-53) 星期一是一周的第一天,与 %x 使用 | -| %W | 星期名 | +| %W | 周中日的名称 (Sunday-Saturday) | | %w | 周的天(0=星期日,6=星期六) | | %X | 年,其中的星期日是周的第一天,4 位,与 %V 使用 | | %x | 年,其中的星期一是周的第一天,4 位,与 %v 使用 | | %Y | 年,4 位 | | %y | 年,2 位 | | %% | 用于表示 % | +| %**x** | 对于任何未出现在上列的 **x**,表示 **x** 本身 | 还可以使用三种特殊格式: + ```text yyyyMMdd yyyy-MM-dd @@ -89,6 +90,7 @@ yyyy-MM-dd HH:mm:ss ## 返回值 格式化后的日期字符串,特殊情况: + - 当前支持最大 128 字节的字符串,如果返回值长度超过 128,则返回 NULL。 ## 举例 @@ -175,4 +177,4 @@ select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ | %01 | +--------------------------------------------+ -``` \ 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/date-format.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md index 4f7eb4510cc..d7281bc1d48 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md @@ -41,18 +41,17 @@ DATE_FORMAT(<date>, <format>) | `<date>` | 合法的日期值 | | `<format>` | 规定日期/时间的输出格式 | - 支持的 format 格式: | 格式符 | 描述 | |--------|-------------------------------------| -| %a | 缩写星期名 | -| %b | 缩写月名 | -| %c | 月,数值 | -| %D | 带有英文前缀的月中的天 | +| %a | 三字母缩写星期名 | +| %b | 三字母缩写月名 | +| %c | 月,数值 (0-12) | +| %D | 带有英文后缀的月中的天 (0th, 1st, 2nd, 3rd, …) | | %d | 月的天,数值 (00-31) | | %e | 月的天,数值 (0-31) | -| %f | 微秒 | +| %f | 微秒 (000000-999999) | | %H | 小时 (00-23) | | %h | 小时 (01-12) | | %I | 小时 (01-12) | @@ -63,7 +62,7 @@ DATE_FORMAT(<date>, <format>) | %M | 月名 | | %m | 月,数值 (00-12) | | %p | AM 或 PM | -| %r | 时间,12-小时(hh:mm:ss AM 或 PM) | +| %r | 时间,12-小时(hh:mm:ss, 后跟 AM 或 PM) | | %S | 秒 (00-59) | | %s | 秒 (00-59) | | %T | 时间,24-小时 (hh:mm:ss) | @@ -71,15 +70,17 @@ DATE_FORMAT(<date>, <format>) | %u | 周 (00-53) 星期一是一周的第一天 | | %V | 周 (01-53) 星期日是一周的第一天,与 %X 使用 | | %v | 周 (01-53) 星期一是一周的第一天,与 %x 使用 | -| %W | 星期名 | +| %W | 周中日的名称 (Sunday-Saturday) | | %w | 周的天(0=星期日,6=星期六) | | %X | 年,其中的星期日是周的第一天,4 位,与 %V 使用 | | %x | 年,其中的星期一是周的第一天,4 位,与 %v 使用 | | %Y | 年,4 位 | | %y | 年,2 位 | | %% | 用于表示 % | +| %**x** | 对于任何未出现在上列的 **x**,表示 **x** 本身 | 还可以使用三种特殊格式: + ```text yyyyMMdd yyyy-MM-dd @@ -89,6 +90,7 @@ yyyy-MM-dd HH:mm:ss ## 返回值 格式化后的日期字符串,特殊情况: + - 当前支持最大 128 字节的字符串,如果返回值长度超过 128,则返回 NULL。 ## 举例 @@ -175,4 +177,4 @@ select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ | %01 | +--------------------------------------------+ -``` \ No newline at end of file +``` diff --git a/versioned_docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md b/versioned_docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md index 54f2acd7597..145fde68325 100644 --- a/versioned_docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md +++ b/versioned_docs/version-2.0/sql-manual/sql-functions/date-time-functions/date-format.md @@ -38,69 +38,41 @@ The date parameter is the valid date. Format specifies the date/time output form The formats available are: -% a | Abbreviation for Sunday Name - -% B | Abbreviated Monthly Name - -% C | Month, numerical value - -% D | Sky in the Moon with English Prefix - -% d | Monthly day, numerical value (00-31) - -% e | Monthly day, numerical value (0-31) - -% f | microseconds - -% H | Hours (00-23) - -% h | hour (01-12) - -% I | Hours (01-12) - -% I | min, numerical value (00-59) - -% J | Days of Year (001-366) - -% k | hours (0-23) - -% L | Hours (1-12) - -% M | Moon Name - -% m | month, numerical value (00-12) - -% p | AM or PM, only available on 12-hours system - -% R | Time, 12-hour (hh:mm:ss), could be with or without AM/PM marking - -% S | seconds (00-59) - -% s | seconds (00-59) - -% T | Time, 24-hour (hh:mm:ss) - -% U | Week (00-53) Sunday is the first day of the week - -% U | Week (00-53) Monday is the first day of the week - -% V | Week (01-53) Sunday is the first day of the week, and% X is used. - -% v | Week (01-53) Monday is the first day of the week, and% x is used - -% W | Sunday - -% w | Weekly day (0 = Sunday, 6 = Saturday) - -% X | Year, where Sunday is the first day of the week, 4 places, and% V use - -% x | year, of which Monday is the first day of the week, 4 places, and% V - -% Y | Year, 4 - -% y | Year, 2 - -%% | Represent % +| Format | Description | +|---------|----------------------------------------------------------------------| +| %a | Abbreviated weekday name (Sun..Sat) | +| %b | Abbreviated month name (Jan..Dec) | +| %c | Month, numeric (0..12) | +| %D | Day of the month with English suffix (0th, 1st, 2nd, 3rd, …) | +| %d | Day of the month, numeric (00..31) | +| %e | Day of the month, numeric (0..31) | +| %f | Microseconds (000000..999999) | +| %H | Hour (00..23) | +| %h | Hour (01..12) | +| %I | Hour (01..12) | +| %i | Minutes, numeric (00..59) | +| %j | Day of year (001..366) | +| %k | Hour (0..23) | +| %l | Hour (1..12) | +| %M | Month name (January..December) | +| %m | Month, numeric (00..12) | +| %p | AM or PM | +| %r | Time, 12-hour (hh:mm:ss followed by AM or PM) | +| %S | Seconds (00..59) | +| %s | Seconds (00..59) | +| %T | Time, 24-hour (hh:mm:ss) | +| %U | Week (00..53), where Sunday is the first day of the week; [WEEK](./week) mode 0 | +| %u | Week (00..53), where Monday is the first day of the week; [WEEK](./week) mode 1 | +| %V | Week (01..53), where Sunday is the first day of the week; [WEEK](./week) mode 2; used with %X | +| %v | Week (01..53), where Monday is the first day of the week; [WEEK](./week) mode 3; used with %x | +| %W | Weekday name (Sunday..Saturday) | +| %w | Day of the week (0=Sunday..6=Saturday) | +| %X | Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V | +| %x | Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v | +| %Y | Year, numeric, four digits | +| %y | Year, numeric (two digits) | +| %% | A literal % character | +| %**x** | **x**, for any “**x**” not listed above | Also support 3 formats: diff --git a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md index 062723521ab..48593af61ae 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md +++ b/versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md @@ -41,45 +41,46 @@ DATE_FORMAT(<date>, <format>) | `<date>` | A valid date value | | `<format>` | Specifies the output format for the date/time | - The formats available are: | Format | Description | |---------|----------------------------------------------------------------------| -| %a | Abbreviation for Sunday Name | -| %b | Abbreviated Monthly Name | -| %c | Month, numerical value | -| %D | Sky in the Moon with English Prefix | -| %d | Monthly day, numerical value (00-31) | -| %e | Monthly day, numerical value (0-31) | -| %f | Microseconds | -| %H | Hours (00-23) | -| %h | Hour (01-12) | -| %I | Hours (01-12) | -| %i | Minutes, numerical value (00-59) | -| %j | Days of Year (001-366) | -| %k | Hours (0-23) | -| %l | Hours (1-12) | -| %M | Moon Name | -| %m | Month, numerical value (00-12) | -| %p | AM or PM | -| %r | Time, 12-hour (hh:mm:ss AM or PM) | -| %S | Seconds (00-59) | -| %s | Seconds (00-59) | -| %T | Time, 24-hour (hh:mm:ss) | -| %U | Week (00-53) Sunday is the first day of the week | -| %u | Week (00-53) Monday is the first day of the week | -| %V | Week (01-53) Sunday is the first day of the week, and %X is used | -| %v | Week (01-53) Monday is the first day of the week, and %x is used | -| %W | Sunday | -| %w | Weekly day (0 = Sunday, 6 = Saturday) | -| %X | Year, where Sunday is the first day of the week, 4 digits, and %V used| -| %x | Year, where Monday is the first day of the week, 4 digits, and %V used| -| %Y | Year, 4 digits | -| %y | Year, 2 digits | -| %% | Represent % | +| %a | Abbreviated weekday name (Sun..Sat) | +| %b | Abbreviated month name (Jan..Dec) | +| %c | Month, numeric (0..12) | +| %D | Day of the month with English suffix (0th, 1st, 2nd, 3rd, …) | +| %d | Day of the month, numeric (00..31) | +| %e | Day of the month, numeric (0..31) | +| %f | Microseconds (000000..999999) | +| %H | Hour (00..23) | +| %h | Hour (01..12) | +| %I | Hour (01..12) | +| %i | Minutes, numeric (00..59) | +| %j | Day of year (001..366) | +| %k | Hour (0..23) | +| %l | Hour (1..12) | +| %M | Month name (January..December) | +| %m | Month, numeric (00..12) | +| %p | AM or PM | +| %r | Time, 12-hour (hh:mm:ss followed by AM or PM) | +| %S | Seconds (00..59) | +| %s | Seconds (00..59) | +| %T | Time, 24-hour (hh:mm:ss) | +| %U | Week (00..53), where Sunday is the first day of the week; [WEEK](./week) mode 0 | +| %u | Week (00..53), where Monday is the first day of the week; [WEEK](./week) mode 1 | +| %V | Week (01..53), where Sunday is the first day of the week; [WEEK](./week) mode 2; used with %X | +| %v | Week (01..53), where Monday is the first day of the week; [WEEK](./week) mode 3; used with %x | +| %W | Weekday name (Sunday..Saturday) | +| %w | Day of the week (0=Sunday..6=Saturday) | +| %X | Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V | +| %x | Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v | +| %Y | Year, numeric, four digits | +| %y | Year, numeric (two digits) | +| %% | A literal % character | +| %**x** | **x**, for any “**x**” not listed above | Also support 3 formats: + ```text yyyyMMdd yyyy-MM-dd @@ -89,6 +90,7 @@ yyyy-MM-dd HH:mm:ss ## Return Value The formatted date string, with the following special case: + - Currently, a maximum of 128 bytes of string is supported. If the returned value exceeds 128 bytes, it will return NULL. ## Examples @@ -175,4 +177,4 @@ select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ | %01 | +--------------------------------------------+ -``` \ No newline at end of file +``` diff --git a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md index 062723521ab..48593af61ae 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md +++ b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/date-time-functions/date-format.md @@ -41,45 +41,46 @@ DATE_FORMAT(<date>, <format>) | `<date>` | A valid date value | | `<format>` | Specifies the output format for the date/time | - The formats available are: | Format | Description | |---------|----------------------------------------------------------------------| -| %a | Abbreviation for Sunday Name | -| %b | Abbreviated Monthly Name | -| %c | Month, numerical value | -| %D | Sky in the Moon with English Prefix | -| %d | Monthly day, numerical value (00-31) | -| %e | Monthly day, numerical value (0-31) | -| %f | Microseconds | -| %H | Hours (00-23) | -| %h | Hour (01-12) | -| %I | Hours (01-12) | -| %i | Minutes, numerical value (00-59) | -| %j | Days of Year (001-366) | -| %k | Hours (0-23) | -| %l | Hours (1-12) | -| %M | Moon Name | -| %m | Month, numerical value (00-12) | -| %p | AM or PM | -| %r | Time, 12-hour (hh:mm:ss AM or PM) | -| %S | Seconds (00-59) | -| %s | Seconds (00-59) | -| %T | Time, 24-hour (hh:mm:ss) | -| %U | Week (00-53) Sunday is the first day of the week | -| %u | Week (00-53) Monday is the first day of the week | -| %V | Week (01-53) Sunday is the first day of the week, and %X is used | -| %v | Week (01-53) Monday is the first day of the week, and %x is used | -| %W | Sunday | -| %w | Weekly day (0 = Sunday, 6 = Saturday) | -| %X | Year, where Sunday is the first day of the week, 4 digits, and %V used| -| %x | Year, where Monday is the first day of the week, 4 digits, and %V used| -| %Y | Year, 4 digits | -| %y | Year, 2 digits | -| %% | Represent % | +| %a | Abbreviated weekday name (Sun..Sat) | +| %b | Abbreviated month name (Jan..Dec) | +| %c | Month, numeric (0..12) | +| %D | Day of the month with English suffix (0th, 1st, 2nd, 3rd, …) | +| %d | Day of the month, numeric (00..31) | +| %e | Day of the month, numeric (0..31) | +| %f | Microseconds (000000..999999) | +| %H | Hour (00..23) | +| %h | Hour (01..12) | +| %I | Hour (01..12) | +| %i | Minutes, numeric (00..59) | +| %j | Day of year (001..366) | +| %k | Hour (0..23) | +| %l | Hour (1..12) | +| %M | Month name (January..December) | +| %m | Month, numeric (00..12) | +| %p | AM or PM | +| %r | Time, 12-hour (hh:mm:ss followed by AM or PM) | +| %S | Seconds (00..59) | +| %s | Seconds (00..59) | +| %T | Time, 24-hour (hh:mm:ss) | +| %U | Week (00..53), where Sunday is the first day of the week; [WEEK](./week) mode 0 | +| %u | Week (00..53), where Monday is the first day of the week; [WEEK](./week) mode 1 | +| %V | Week (01..53), where Sunday is the first day of the week; [WEEK](./week) mode 2; used with %X | +| %v | Week (01..53), where Monday is the first day of the week; [WEEK](./week) mode 3; used with %x | +| %W | Weekday name (Sunday..Saturday) | +| %w | Day of the week (0=Sunday..6=Saturday) | +| %X | Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V | +| %x | Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v | +| %Y | Year, numeric, four digits | +| %y | Year, numeric (two digits) | +| %% | A literal % character | +| %**x** | **x**, for any “**x**” not listed above | Also support 3 formats: + ```text yyyyMMdd yyyy-MM-dd @@ -89,6 +90,7 @@ yyyy-MM-dd HH:mm:ss ## Return Value The formatted date string, with the following special case: + - Currently, a maximum of 128 bytes of string is supported. If the returned value exceeds 128 bytes, it will return NULL. ## Examples @@ -175,4 +177,4 @@ select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ | %01 | +--------------------------------------------+ -``` \ 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