Example #1
0
 /**
  * Answer the Time Zone that corresponds to our offset.
  * 
  * @return object TimeZone
  * @access public
  * @since 5/10/05
  */
 function timeZone()
 {
     // Search through the array of timezones for one that matches. Otherwise,
     // build our own. The name and abbreviation are just a guess, as multiple
     // Time Zones have the same offset.
     $zoneArray = TimeZone::timeZones();
     foreach (array_keys($zoneArray) as $key) {
         if ($this->offset->isEqualTo($zoneArray[$key]->offset())) {
             return $zoneArray[$key];
         }
     }
     $obj = TimeZone::offsetNameAbbreviation($this->offset, $tzAbbreviation, $tzAbbreviation);
     return $obj;
 }