3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $utc = new DateTimeZone('UTC'); $brw = new DateTimeZone('Brazil/West'); $dt = new DateTime('2016-02-05T00:00:00-04:00'); $dt2 = new DateTime('2016-02-05T00:00:00-04:00', $utc); $dt3 = new DateTime('2016-02-05T00:00:00', $brw); var_dump($dt->format('Y-m-d H:i:s')); var_dump($dt2); var_dump($dt3);
based on 2i0ur
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
string(19) "2016-02-05 00:00:00" object(DateTime)#4 (3) { ["date"]=> string(26) "2016-02-05 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "-04:00" } object(DateTime)#5 (3) { ["date"]=> string(26) "2016-02-05 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(11) "Brazil/West" }