public static function pushTime($epoch, $timezone) { if (empty(self::$stack)) { self::$originalZone = date_default_timezone_get(); } $ok = date_default_timezone_set($timezone); if (!$ok) { throw new Exception(pht("Invalid timezone '%s'!", $timezone)); } self::$stack[] = array('epoch' => $epoch, 'timezone' => $timezone); return new PhabricatorTimeGuard(last_key(self::$stack)); }