異なるタイムゾーンの2倍の違いを知りたい。 私のサーバーは、シドニーに基づいており、私はそれが違い、2時間を与えたdiffInSeconds
を使用秒タイムゾーンに基づく炭素の2秒間の差
echo $tz = Carbon::now('Australia/Perth');
echo "<br>";
$local='2017-04-11 12:39:50';
echo $emitted = Carbon::parse($local);
echo "<br>";
echo "diff from carbon->";
echo $diff = $tz->diffInSeconds($emitted);
echo "<br> diff from Normal->";
echo $diff1 = strtotime($tz) - strtotime($emitted);
内の指定された時間と(パースに基づいて)、現在の時刻の差を見つけたいとローカリゼーションが取られていないように見えるさ考察 でもstrtotime($tz) - strtotime($emitted)
であれば完璧な結果が得られます。私が見逃したことは?