ZF-7719: Zend_Date change default output format


I miss some functionality like Zend_Date::setDefaultFormat('mm.YY'); or Zend_Date::setOption('defaultOutput', 'mm.YY'); that will change the default output format for __toString() etc application wide for any instanciated Zend_Date.


Per the documentation (and the code) there's a toString() method, which accepts the date format as it's first parameter:…

So this could be easily achieved as:

define(MY_DATE_FORMAT, 'Y-m-d H:i:s');

echo $date->toString(MY_DATE_FORMAT);