ZF-9711: Bug (?) with dates of February month for leap years earlier than 1900
it seems to me there is a bug in Zend_date related to leap years earlier than 1900. The problem occurs only with February days.
I construct a date: $myDate = new Zend_Date('25/02/1824', 'dd/MM/YYYY');
Then I display it using a different format:
The result is: 1824/02/26
The day is changed !?!?
I made several tests, and it seems to me that this problem occurs only with dates of February month in leap years before 1900.
Are dates earlier than 1900 are supposed to be supported by Zend_Date ? Did I miss something (explicitly configuring something, like timezone ... ?)
UPDATE: I posted a test file to reproduce the problem. The code is:
<?php defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(FILE) . '/'));
set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/library'), get_include_path())));
$strInitialDate='25/02/1824'; $myDate = new Zend_Date($strInitialDate, 'dd/MM/YYYY'); $strFormattedDate= $myDate->toString('YYYY/MM/dd');
echo "Initial date ('dd/MM/YYYY'): ".$strInitialDate; echo "\n"; echo "Formatted date ('YYYY/MM/dd'): ".$strFormattedDate; echo "\n";