3v4l.org

run code in 200+ PHP versions simultaneously
<?php date_default_timezone_set('America/Los_Angeles'); $now = new Datetime("2013-04-09 23:45:15",new DateTimeZone("UTC")); $lv = new Datetime("2013-04-09 23:44:21",new DateTimeZone('America/Los_Angeles')); $interval = $lv->diff($now,true); print_r($lv); print_r($now); print_r($interval);