Skip to main content
Since 1.16.0 Given a timestamptz, returns how many days are in that month.

Samples

Calculate how many days in the month of January 1, 2022:
SELECT days_in_month('2021-01-01 00:00:00+03'::timestamptz)
The output looks like this:
days_in_month
---------------------
31

Arguments

NameTypeDefaultRequiredDescription
dateTIMESTAMPTZ-Timestamp to use to calculate how many days in the month