3v4l.org

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

preferences:
30.63 ms | 402 KiB | 5 Q