1
我有日期從冬季/夏季時間穿越的問題..請參見例如Zend的日期和夏季
$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;
回聲產生9 ...我的時區是倫敦,但我認爲fix_dst應該可以解決夏季問題?我也嘗試將時區設置爲GMT和UTC,但具有相同的效果?有任何想法嗎?