Is there a way to use extract from date in format YYYY-MM-DD
how many days were in this month?
example:
for 2016-02-05
it will give 29
(Feb 2016 has 29 days)
for 2016-03-12
it will give 31
for 2015-02-05
it will give 28
(Feb 2015 had 28 days)
I'm using PostgreSQL
EDIT:
LAST_DAY function in postgres is not what i'm looking for. it returns DATE while I expect an Integer