Name = $tz->getName(); $this->Offset = $tz->getOffset(new DateTime()); $this->OffsetHours = $this->Offset / 3600; $this->OffsetMinutes = $this->Offset % 3600 / 60; $this->Label = sprintf('UTC%+03d:%02d %s', $this->OffsetHours, $this->OffsetMinutes, $this->Name); } public static function __compare(TimezoneDTO $tz1, TimezoneDTO $tz2) { $diff = $tz1->Offset - $tz2->Offset; return ($diff == 0) ? strcmp($tz1->Name, $tz2->Name) : $diff; } } ?>