Parameter | Type |
---|---|
units | string |
dateValue | datetimestamp, datetime, date, time, gyear, gyearmonth |
Returns: integer
Example
query:
SELECT DATE_PART("month", CAST("2018-01-02" AS DATE))
results:
date_part |
---|
1 |
The date function used to find the numeric value for a part of a date or datetime value. Takes two arguments: the date to be evaluated, and the unit of time to find from it (one of "timezone", "timezonehour", "timezoneminute", "year", "decade", "century", "quarter", "month", "week", "day", "dayofweek", "dayofyear", "hour", "minute", "second", or "millisecond").
Parameter | Type |
---|---|
units | string |
dateValue | datetimestamp, datetime, date, time, gyear, gyearmonth |
query:
SELECT DATE_PART("month", CAST("2018-01-02" AS DATE))
results:
date_part |
---|
1 |