我对冬季/夏季时间跨过的日期有疑问。请参阅示例
$pickUpDate = '2011-10-23';
$dropOffDate = '2011-10-31';
$pickUpTime = '09:00';
$dropOffTime = '09:00';
Zend_Date::setOptions(array('fix_dst' => false));
Zend_Date::setOptions(array('fix_dst' => false));
$pickUpDateTime = new Zend_Date ( $pickUpDate);
$pickUpDateTime->setTime ( $pickUpTime );
$dropOffDateTime = new Zend_Date ( $dropOffDate);
$dropOffDateTime->setTime ( $dropOffTime );
$dateDiff = ceil(($dropOffDateTime->getTimestamp ( ) - $pickUpDateTime->getTimestamp ( )) / (3600 * 24));
echo $dateDiff;
Echo 产生 9... 我的时区是伦敦,但我认为 fix_dst 应该解决夏令时问题?我也尝试将时区设置为 GMT 和 UTC,但效果相同吗?有任何想法吗?