3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); echo date_default_timezone_get(), PHP_EOL; $time = DateTime::createFromFormat('Y-m-d H:i:s', '2014-05-19 11:30:00'); foreach (['UTC', 'Europe/London', 'BST', 'Etc/GMT+1', 'GMT+1', 'CEST', 'EST', 'GMT-5', 'Etc/GMT-5'] as $abbr) { try { $time->setTimezone(new DateTimeZone($abbr)); echo "{$abbr}: {$time->format(DATE_RFC822)}", PHP_EOL; } catch (Exception $e) { echo "{$abbr}: ERROR - {$e->getMessage()}", PHP_EOL; } }

preferences:
47.11 ms | 402 KiB | 5 Q