ZF-12141: Zend_Date::toString returns wrong date for some 'php' formats
$date = new Zend_Date(); echo $date->toString(DateTime::ATOM, 'php'); // 2012-04-09\UTC12:21:48+00:00
This code display 2012-04-09\UTC12:21:48+00:00 but 2012-04-09T12:21:48+00:00 is expected instead.
But example bellow works as expected:
$date = new Zend_Date(); echo $date->toString(Zend_Date::ATOM); // 2012-04-09T12:21:48+00:00
The basic problem is that Zend_Date::toString uses Zend_Locale_Format::convertPhpToIsoFormat for php format type that works incorrectly with formats that contain symbols are escaped with backslash (\T in example). Zend_Locale_Format::convertPhpToIsoFormat just splits format string to array and convert each symbol to ISO separately. But it should be more complicated. The simplest way to fix it is to get escaped symbol right after backslash and put it into single quotes so Zend_Date will parse it as comment.