Added documentation for date_trunc function.

This commit is contained in:
vladimir golovchenko 2020-08-19 06:22:39 -07:00
parent fb06f59ceb
commit 962dd04ec0

View File

@ -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.