3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $b = new DateTime(); echo "Current: ".$b->format('Y-m-d H:i:s'); echo "\r\n"; echo "\r\n"; $t = new DateTime("07:00", new DateTimeZone('America/New_York')); $t->setTimezone(new DateTimeZone('UTC')); echo "ET: ".$t->format('Y-m-d H:i:s'); $f = (new DateTime())->setTimezone(new DateTimeZone('America/New_York')); $f->setTime(7,0); $f->setTimezone(new DateTimeZone('UTC')); echo "\r\n"; echo "ET Second Way: ".$f->format('Y-m-d H:i:s'); echo "\r\n"; $t = new DateTime("07:00", new DateTimeZone('America/Chicago')); $t->setTimezone(new DateTimeZone('UTC')); echo "ET: ".$t->format('Y-m-d H:i:s'); $f = (new DateTime())->setTimezone(new DateTimeZone('America/Chicago')); $f->setTime(7,0); $f->setTimezone(new DateTimeZone('UTC')); echo "\r\n"; echo "ET Second Way: ".$f->format('Y-m-d H:i:s'); echo "\r\n"; $t = new DateTime("07:00", new DateTimeZone('America/Denver')); $t->setTimezone(new DateTimeZone('UTC')); echo "ET: ".$t->format('Y-m-d H:i:s'); $f = (new DateTime())->setTimezone(new DateTimeZone('America/Denver')); $f->setTime(7,0); $f->setTimezone(new DateTimeZone('UTC')); echo "\r\n"; echo "ET Second Way: ".$f->format('Y-m-d H:i:s'); echo "\r\n"; $t = new DateTime("07:00", new DateTimeZone('America/Los_Angeles')); $t->setTimezone(new DateTimeZone('UTC')); echo "ET: ".$t->format('Y-m-d H:i:s'); $f = (new DateTime())->setTimezone(new DateTimeZone('America/Los_Angeles')); $f->setTime(7,0); $f->setTimezone(new DateTimeZone('UTC')); echo "\r\n"; echo "ET Second Way: ".$f->format('Y-m-d H:i:s'); echo "\r\n---"; $f = new DateTime("07:00", new DateTimeZone('America/Chicago')); $f->setTimezone(new DateTimeZone('UTC')); echo $f->format('Y-m-d H:i:s'); echo "\r\n"; echo "\r\n"; $f = new DateTime(); $f->setTimezone(new DateTimeZone('America/Chicago')); echo $f->format('Y-m-d H:i:s'); $f = new DateTime(); $f->setTime(7,0); echo "\r\n"; $f->setTimezone(new DateTimeZone('America/Chicago')); echo $f->format('Y-m-d H:i:s'); echo "\r\n"; echo "\r\n"; $g = new DateTime("07:00", new DateTimeZone('America/Denver')); $g->setTimezone(new DateTimeZone('UTC')); echo $g->format('Y-m-d H:i:s'); echo "\r\n"; $h = new DateTime("07:00", new DateTimeZone('America/Los_Angeles')); $h->setTimezone(new DateTimeZone('UTC')); echo $h->format('Y-m-d H:i:s'); echo "\r\n"; echo strtotime('today 7am'); echo "\r\n"; echo (new DateTime())->setTimestamp(strtotime('today 7am'))->format('Y-m-d H:i:s');
Output for git.master, git.master_jit, rfc.property-hooks
Current: 2020-10-18 02:27:18 ET: 2020-10-17 11:00:00 ET Second Way: 2020-10-17 11:00:00 ET: 2020-10-17 12:00:00 ET Second Way: 2020-10-17 12:00:00 ET: 2020-10-17 13:00:00 ET Second Way: 2020-10-17 13:00:00 ET: 2020-10-17 14:00:00 ET Second Way: 2020-10-17 14:00:00 ---2020-10-17 12:00:00 2020-10-17 21:27:18 2020-10-18 02:00:00 2020-10-17 13:00:00 2020-10-17 14:00:00 1603004400 2020-10-18 07:00:00

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
60.41 ms | 402 KiB | 8 Q