I am trying to get the following in Postgres:

select day_in_month(2);

Expected output:

28

Is there any built-in way in Postgres to do that?

Edit
Report