PHP DateTime Timezones - Constructor vs Setter method
问题 When using the PHP DateTime class and try to set a DateTimeZone I get different results depending on how I set it: using the DateTime::__construct or using the DateTime::setTimezone method. here is an example: $date = '2014-08-01' $dateTimeOne = new DateTime($date, new DateTimeZone('America/Los_Angeles')); echo $dateTimeOne->format('Y-m-d\TH:i:sP'); // 2014-08-01T00:00:00-07:00 $dateTimeTwo = new DateTime($date); $dateTimeTwo->setTimezone(new DateTimeZone('America/Los_Angeles')); echo