2012-03-13 147 views
0

我需要與日期的PHP操作與格式ISO 8601是這樣的:格式爲ISO 8601的日期操作?

$starDate = 2012-03-20T00:00:00+01:00; //20 March 2012 
$endDate = 2012-04-01T00:00:00+02:00; // 1 April 2012 

$diff = $starDate - $endDate; //Result should be: 13 

使用此代碼$ DIFF得到CERO的值。

+0

複製? http://stackoverflow.com/questions/5988450/difference-between-2-dates-in-seconds and http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-兩個日期使用PHP – ChapMic 2012-03-13 19:50:54

回答

相關問題