When you’re creating reports you will often work with a date range, a start date and end date. If it’s a monthly report the user will select month and pass this to the report function.
This function will then work out the start and end date, for example if the month passed in was February the start and end date would be 1st February 2012 to the 29th February 2012. To get the last day in February, use the get method Zend_Date::MONTH_DAYS constants to return the last day of the month the 29th.
// Current Month is February 2012 $date = new Zend_Date(); $lastDayofMonth = $date->get(Zend_Date::MONTH_DAYS); echo 'Last day of month = '. $lastDayofMonth;