edgar2020 commented on code in PR #16900: URL: https://github.com/apache/druid/pull/16900#discussion_r1717621475
########## docs/querying/sql-functions.md: ########## @@ -807,28 +807,71 @@ Returns the cumulative distribution of the current row within the window calcula ## CURRENT_DATE -`CURRENT_DATE` +Returns the current date in the connection's time zone. -**Function type:** [Scalar, date and time](sql-scalar.md#date-and-time-functions) +* **Syntax:** `CURRENT_DATE` +* **Function type:** Scalar, date and time -Returns the current date in the connection's time zone. +<details><summary>Example</summary> -## CURRENT_TIMESTAMP +The following example returns the current date. -`CURRENT_TIMESTAMP` +```sql +SELECT CURRENT_DATE AS "current_date" +``` -**Function type:** [Scalar, date and time](sql-scalar.md#date-and-time-functions) +Returns the following: + +| `current_date` | +| -- | +| `2024-08-14T00:00:00.000Z `| + +</details> + +[Learn more](sql-scalar.md#date-and-time-functions) + +## CURRENT_TIMESTAMP Returns the current timestamp in the connection's time zone. -## DATE_TRUNC -`DATE_TRUNC(<CHARACTER>, <TIMESTAMP>)` +* **Syntax:** `CURRENT_TIMESTAMP` +* **Function type:** Scalar, date and time -**Function type:** [Scalar, date and time](sql-scalar.md#date-and-time-functions) +<details><summary>Example</summary> + +The following example returns the current timestamp: + +```sql +SELECT CURRENT_TIMESTAMP AS "current_timestamp" +``` + +Returns the following: + +| `current_timestamp` | +| -- | +| `2024-08-14T21:30:13.793Z` | + +</details> + +[Learn more](sql-scalar.md#date-and-time-functions) + +## DATE_TRUNC Review Comment: For example both `century` and `millennium` converts: `2013-08-01T08:14:37.000Z` to `1970-01-01T00:00:00.000Z`(EPOCH time). Should it not be `2000-01-01T00:00:00.000Z` for both? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
