DAYS_IN_MONTH
Description
Returns the number of days in the given month of the given timestamp.
Supported input column type: DATE
Output column type: INT
Syntax
DAYS_IN_MONTH( table.column )
NULL handling
If any parameter is NULL, the result is NULL as well.
Examples
[1] In this example, the number of days for each month in year 2020 is returned. | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
[2] The month of February has 28 or 29 days, depending on whether the year is a leap year. | ||||||||||||||||||
| ||||||||||||||||||
|
[3] DAYS_IN_MONTH does not consider the day in the given timestamp. Even if an incorrect timestamp is provided, it will still return the actual number of days in the month. | ||||||||||||||
| ||||||||||||||
|