Skip to content

Instantly share code, notes, and snippets.

@galen
Created March 15, 2013 13:49
Show Gist options
  • Save galen/5170000 to your computer and use it in GitHub Desktop.
Save galen/5170000 to your computer and use it in GitHub Desktop.
Setting timezones with DateTime
$utc_time = '';
$date_obj = new DateTime($utc_time, new DateTimeZone("UTC"));
$date_obj->setTimeZone("America/Los_Angeles");
$display_date = $date_obj->format("Y-m-d H:i:s");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment