$currentDT = new \DateTime();
$filterRange = new \DateInterval('PT30S');
$filterDate = $currentDT->sub($filterRange);
var_dump($currentDT);
var_dump($filterDate);
출력 :PHP 날짜 하위 문제
object(DateTime)[246]
public 'date' => string '2011-12-10 15:53:42' (length=19)
public 'timezone_type' => int 3
public 'timezone' => string 'America/New_York' (length=16)
object(DateTime)[246]
public 'date' => string '2011-12-10 15:53:42' (length=19)
public 'timezone_type' => int 3
public 'timezone' => string 'America/New_York' (length=16)
서로 다른 30 대 있어야한다하더라도 $ currentDT 및 $ filterDate이 ... 동일합니다. 왜 그런가?