3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); echo json_encode($now->format(\DateTime::ISO8601)); $new = new DateTime('2016-01-12T10:25:29+0100'); echo $new->format('Y-m-d H:i:s'); echo json_encode(new DateTime('@1419237113')); $datetime = new DateTime('2014-12-22 08:31:53');
based on BHUVm
Output for 5.6.28, 7.0.20 - 7.2.0
"2016-01-12T10:26:59+0100"2016-01-12 10:25:29{"date":"2014-12-22 08:31:53.000000","timezone_type":1,"timezone":"+00:00"}
Output for 5.5.14 - 5.6.24, 7.0.0 - 7.0.9
"2016-01-12T10:26:58+0100"2016-01-12 10:25:29{"date":"2014-12-22 08:31:53.000000","timezone_type":1,"timezone":"+00:00"}
Output for 5.5.0 - 5.5.13
"2016-01-12T10:26:58+0100"2016-01-12 10:25:29{"date":"2014-12-22 08:31:53","timezone_type":1,"timezone":"+00:00"}