days_in_month()
ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale, but must be installed separately for self-hosted TimescaleDB. Click to learn more.Given a timestamptz, returns how many days are in that month.
Name | Type | Description |
---|---|---|
date | TIMESTAMPTZ | Timestamp to use to calculate how many days in the month |
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
Keywords
Found an issue on this page?Report an issue or Edit this page in GitHub.