title: How to get number of days in month based on date?
body: <p>Is there a way to use extract from date in format <code>YYYY-MM-DD</code> how many days were in this month? </p>
  
  <p>example:</p>
  
  <p>for <code>2016-02-05</code> it will give <code>29</code>   (Feb 2016 has 29 days)</p>
  
  <p>for <code>2016-03-12</code> it will give <code>31</code></p>
  
  <p>for <code>2015-02-05</code> it will give <code>28</code>   (Feb 2015 had 28 days)</p>
  
  <p>I'm using PostgreSQL</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/14229038/last-day-function-in-postgres">LAST_DAY function in postgres</a> is not what i'm looking for. it returns DATE while I expect an Integer</p>