1 | <?php |
||
9 | abstract class DateTimeZoneUtil implements TimezonesInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | const OUTLIERS = [ |
||
15 | 'WIB' => self::TIMEZONE_ASIA_JAKARTA, //Western Indonesian Time |
||
16 | 'FET' => self::TIMEZONE_EUROPE_HELSINKI, //Further-eastern European Time |
||
17 | 'AEST' => self::TIMEZONE_AUSTRALIA_TASMANIA, //Australia Eastern Standard Time |
||
18 | 'AWST' => self::TIMEZONE_AUSTRALIA_WEST, //Australia Western Standard Time |
||
19 | 'WITA' => self::TIMEZONE_ASIA_MAKASSAR, |
||
20 | 'AEDT' => self::TIMEZONE_AUSTRALIA_SYDNEY, //Australia Eastern Daylight Time |
||
21 | 'ACDT' => self::TIMEZONE_AUSTRALIA_ADELAIDE, //Australia Central Daylight Time |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Returns a \DateTimeZone instance for the give nameOrAbbreviation. |
||
26 | * |
||
27 | * @param string $nameOrAbbreviation The timezone nameOrAbbreviation. |
||
28 | * @param \DateTimeZone $default The default timezone to return if none can be created. |
||
29 | * |
||
30 | * @return \DateTimeZone |
||
31 | */ |
||
32 | final public static function fromString(string $nameOrAbbreviation, \DateTimeZone $default = null) |
||
44 | |||
45 | /** |
||
46 | * Returns a \DateTimeZone object based on gmt offset. |
||
47 | * |
||
48 | * @param integer $gmtOffset Offset from GMT in seconds. |
||
49 | * @param boolean $isDaylightSavings Daylight saving time indicator. |
||
50 | * |
||
51 | * @return \DateTimeZone |
||
52 | */ |
||
53 | final public static function fromOffset(int $gmtOffset, bool $isDaylightSavings) |
||
57 | |||
58 | /** |
||
59 | * Returns the long name of the given \DateTimeZone. |
||
60 | * |
||
61 | * @param \DateTimeZone $timezone The timezone object from which the long name should be obtained. |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | final public static function getLongName(\DateTimeZone $timezone) |
||
76 | } |
||
77 |