<?php
date_default_timezone_set('UTC');
echo date_default_timezone_get(), PHP_EOL;
$utc = new DateTimeZone('UTC');
$time = DateTime::createFromFormat('Y-m-d H:i:s', '2014-05-19 11:30:00', $utc);
foreach (['UTC', 'Europe/London', 'BST', 'Etc/GMT+1', 'GMT+1', 'CEST', 'EST', 'Etc/GMT-5', 'GMT-5', '+1', '-1'] 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:
61.51 ms | 402 KiB | 5 Q