Last active
July 4, 2016 09:39
-
-
Save aa21/a8afae7ee20ed1f2bf9973ed892f919b to your computer and use it in GitHub Desktop.
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
<?php | |
// if it's not a ISO8601 date string, skip it | |
if(stripos($v , "T") === false) continue; | |
$dateval = $v; | |
// create ISO8601 dateTime | |
$date = DateTime::createFromFormat(DateTime::ISO8601, $dateval); | |
// set to user's timezone | |
$date -> setTimeZone($dt_user_timezone); | |
// assign back to main events array | |
$events[$id][$k] = $date -> format(DateTime::ISO8601); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment