ZF-6199: Incorrect disambiguation of format in Zend_Date
There appears to be a problem with date disambiguation on formats which should not be ambiguous. Dates in the form YYYY-MM-DD should, I believe, never be misinterpreted as YYYY-DD-MM. (This is only a problem in DD/MM/YYYY vs MM/DD/YYYY). Amazon returns their dates in this format, as does eBay - and likely many other web services.
Example, using a date as might be returned from eBay in ISO 8601 format:
$date = new Zend_Date('2009-04-03T0:00:00.000Z'); echo $date;
Expected (anywhere in the world): Apr 3, 2009 12:00:00 AM
Actual: Mar 4, 2009 12:00:00 AM
I can work around this by calling it as
new Zend_Date('2009-04-03T0:00:00.000Z', 'en_AU')
However, I shouldn't have to, and this is still going to cause problems for people in locales which use the US format.
Slightly related to this issue is the fact that the Z on the end of the date is a timezone indicator for GMT. Perhaps this should override the currently set timezone for the date object, or at least be documented that it is ignored and the timezone needs to be set to GMT manually (I didn't check if differential offsets are handled or not).