Skip to content

Instantly share code, notes, and snippets.

@lighty
Created September 5, 2012 01:40
Show Gist options
  • Save lighty/3628979 to your computer and use it in GitHub Desktop.
Save lighty/3628979 to your computer and use it in GitHub Desktop.
PHPでタイムゾーンの一覧と、その時差を出力するコード
foreach(DateTimeZone::listIdentifiers() as $val){
date_default_timezone_set('UTC');
$utcTime = strtotime('2012-01-01 00:00:00');
date_default_timezone_set($val);
$date = date("Y/m/d H:i:s", $utcTime);
print $val."\t".$date."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment