标签: php datetime floating-point datediff
使用Date :: diff。
$oDate = new DateTime($sStart); $oDiff = $oDate->diff(new DateTime($sEnd)); echo 3 * 6.1;
输出 B.3
$oDate = new DateTime($sStart); echo 3 * 6.1; $oDiff = $oDate->diff(new DateTime($sEnd));
输出 18.3
我错了什么?