mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Added documentation for date_trunc function.
This commit is contained in:
parent
fb06f59ceb
commit
962dd04ec0
@ -339,6 +339,22 @@ SELECT toDate('2016-12-27') AS date, toYearWeek(date) AS yearWeek0, toYearWeek(d
|
||||
└────────────┴───────────┴───────────┴───────────┘
|
||||
```
|
||||
|
||||
## date_trunc(datepart, time\_or\_data\[, time\_zone\]), dateTrunc(datepart, time\_or\_data\[, time\_zone\]) {#date_trunc}
|
||||
|
||||
Truncates a date or date with time based on the specified datepart, such as
|
||||
- `second`
|
||||
- `minute`
|
||||
- `hour`
|
||||
- `day`
|
||||
- `week`
|
||||
- `month`
|
||||
- `quarter`
|
||||
- `year`
|
||||
|
||||
```sql
|
||||
SELECT date_trunc('hour', now())
|
||||
```
|
||||
|
||||
## now {#now}
|
||||
|
||||
Accepts zero arguments and returns the current time at one of the moments of request execution.
|
||||
|
Loading…
Reference in New Issue
Block a user