Tag Archives: performance

Zend_Date caching

What started with a simple month subtraction function ends with a total nightmare on performance. Using Zend_Date is smart because it can correctly calculate the previous month taking into account months like february and leap years.

public static function previousMonth($year, $month)
   $date = new Zend_Date();
   $date->sub(1, Zend_Date::MONTH);

   return = array(

Continue reading Zend_Date caching