Ejemplo n.º 1
0
 /**
  * undocumented function
  *
  * @param unknown $groups
  * @param unknown $includeOffset
  * @return void
  * @access public
  */
 static function listByGroups($groups = array(), $includeOffset = true)
 {
     if (empty($groups)) {
         $groups = TimeZone::listGroups();
     }
     $allZones = DateTimeZone::listIdentifiers();
     $listZones = array();
     foreach ($allZones as $zone) {
         @(list($group, $city) = explode('/', $zone));
         if (!in_array($group, $groups)) {
         } elseif ($includeOffset) {
             $offset = TimeZone::offset($zone);
             $sign = $offset < 0 ? '-' : '+';
             $offset = date('H:i', mktime(0, 0, abs($offset)));
             $listZones[$group][] = $city . ' (GMT ' . $sign . $offset . ')';
         }
     }
     foreach ($listZones as $group => $data) {
         $listZones[$group] = array_unique($listZones[$group]);
     }
     return $listZones;
 }