我一直在使用 Zend_Date。谁能告诉我以下行为是否正常?返回的月份似乎是错误的。我已将输出放在评论中。
谢谢你的帮助!
$oDate = new Zend_Date();
$oDate->setMonth(1);
$oDate->setDay(15);
$oDate->setYear(2012);
echo $oDate->get(Zend_Date::DATETIME_FULL);//Sunday, January 15, 2012 8:24:59 PM Europe/Madrid
$oDate->setMonth(2);
echo $oDate->get(Zend_Date::DATETIME_FULL);//Thursday, March 15, 2012 8:25:20 PM Europe/Madrid
$oDate->setMonth(3);
echo $oDate->get(Zend_Date::DATETIME_FULL);//Thursday, March 15, 2012 8:25:40 PM Europe/Madrid
$oDate->setMonth(4);
echo $oDate->get(Zend_Date::DATETIME_FULL);//Tuesday, May 15, 2012 8:27:32 PM Europe/Madrid
$oDate->setMonth(5);
echo $oDate->get(Zend_Date::DATETIME_FULL);//Tuesday, May 15, 2012 8:28:05 PM Europe/Madrid