DAY
Description
The DAY
function is used to extract the day of the month from a given date or timestamp expression expr
. This function works correctly for both date and timestamp types of data, returning an integer value that represents the day of the month.
Parameter Description
expr
:date
ortimestamp_ltz
type, representing the input date or timestamp.
Return Result
Returns an integer representing the day of the month of the input date or timestamp.
Usage Example
- Extract the day from a specific date:
The result will return 31, indicating that '2022-03-31' is the 31st day of March.
- Extract the day from a timestamp and combine it with other operations:
- Compare two dates to determine if they are on the same day: