Created
September 7, 2016 03:07
-
-
Save michaelbramwell/6b0a5f73ae1f9de4b482a092fad38d8c to your computer and use it in GitHub Desktop.
Set Time Zone From ISO8601 String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function SetTimeZone($dtStr) | |
{ | |
$newDt = DateTime::createFromFormat(DateTime::ISO8601, $dtStr); | |
$newDt->setTimezone(new DateTimeZone('Australia/Perth')); | |
$newDtStr = $newDt->format("c"); | |
return $newDtStr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment