morrySnow commented on code in PR #2212: URL: https://github.com/apache/doris-website/pull/2212#discussion_r2003065212
########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/to-monday.md: ########## @@ -22,25 +22,34 @@ specific language governing permissions and limitations under the License. --> -## to_monday -### Description -#### Syntax +## Description -`DATE to_monday(DATETIME date)` +Rounds a date or a date with a time down to the nearest Monday. As a special case, the date arguments 1970-01-01, 1970-01-02, 1970-01-03, and 1970-01-04 return the date 1970-01-01. -Round a date or datetime down to the nearest Monday, return type is Date or DateV2. -Specially, input 1970-01-01, 1970-01-02, 1970-01-03 and 1970-01-04 will return '1970-01-01' +## Syntax -### example +`TO_MONDAY(<date>)` Review Comment: ````suggestion ```sql TO_MONDAY(<date>) ``` ```` ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/to-monday.md: ########## @@ -22,25 +22,34 @@ specific language governing permissions and limitations under the License. --> -## to_monday -### Description -#### Syntax +## Description -`DATE to_monday(DATETIME date)` +Rounds a date or a date with a time down to the nearest Monday. As a special case, the date arguments 1970-01-01, 1970-01-02, 1970-01-03, and 1970-01-04 return the date 1970-01-01. -Round a date or datetime down to the nearest Monday, return type is Date or DateV2. -Specially, input 1970-01-01, 1970-01-02, 1970-01-03 and 1970-01-04 will return '1970-01-01' +## Syntax -### example +`TO_MONDAY(<date>)` -``` -MySQL [(none)]> select to_monday('2022-09-10'); -+----------------------------------+ -| to_monday('2022-09-10 00:00:00') | -+----------------------------------+ -| 2022-09-05 | -+----------------------------------+ +## Parameters + +| Parameter | Description | +|---|--| +| `<date>` | The corresponding date value is Date or Datetime type | + +## Return Value + +A date or a date with a time rounded down to the nearest Monday. As a special case, the date arguments 1970-01-01, 1970-01-02, 1970-01-03, and 1970-01-04 return the date 1970-01-01. + +## Example + +```sql +SELECT TO_MONDAY('2020-1-1'),TO_MONDAY('2022-7-1 10:11:11'); Review Comment: it is better to add case `1970-01-02` ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/week.md: ########## @@ -24,16 +24,26 @@ specific language governing permissions and limitations under the License. --> -## week -### Description -#### Syntax +## Description -`INT WEEK(DATE date[, INT mode])` +Returns the day of the week for a given date. The default value of mode is 0 -Returns the week number for date.The value of the mode argument defaults to 0. -The following table describes how the mode argument works. +## Syntax -|Mode |First day of week |Range |Week 1 is the first week … | +`WEEK(<date>[, <mode>])` Review Comment: ditto ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/weekofyear.md: ########## @@ -24,27 +24,34 @@ specific language governing permissions and limitations under the License. --> -## weekofyear -### Description -#### Syntax +## Description -`INT WEEKOFYEAR (DATETIME DATE)` +Get the week of the year +## Syntax +`WEEKOFYEAR (<date>)` Review Comment: ````suggestion ```sql WEEKOFYEAR(<date>) ``` ```` ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/unix-timestamp.md: ########## @@ -24,63 +24,35 @@ specific language governing permissions and limitations under the License. --> -## unix_timestamp -### Description -#### Syntax +## Description -`INT UNIX_TIMESTAMP([DATETIME date[, STRING fmt]])` +Converts a Date or Datetime type to a unix timestamp (the conversion is affected by the time zone). If there is no parameter, the current time is converted to a timestamp. For times before 1970-01-01 00:00:00 or after 2038-01-19 03:14:07, the function returns 0. -Converting a Date or Datetime type to a UNIX timestamp. +## Syntax -If there are no parameters, the current time is converted into a timestamp. +`UNIX_TIMESTAMP (<date>[, <fmt>])` Review Comment: ````suggestion ```sql UNIX_TIMESTAMP (<date>[, <fmt>]) ``` ```` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org