我在 php 中有以下 DateTime 对象:
[start1] => DateTime Object (
[date] => 2012-05-21 12:59:59
[timezone_type] => 3
[timezone] => Europe/Berlin
)
[end1] => DateTime Object (
[date] => 2012-05-21 22:36:00
[timezone_type] => 3
[timezone] => Europe/Berlin
)
和结果:
$time->end1->diff($time->start1
是:
DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 12 [i] => 36 [s] => 2 [invert] => 1 [days] => 0 )
为什么我得到的是 12 小时而不是 9 小时?