1 | <?php |
||
7 | abstract class DateTimeZone |
||
8 | { |
||
9 | /** |
||
10 | * Array of edge case timezones |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | private static $outliers = [ |
||
15 | 'WIB' => 'Asia/Jakarta', //Western Indonesian Time |
||
16 | 'FET' => 'Europe/Helsinki', //Further-eastern European Time |
||
17 | 'AEST' => 'Australia/Tasmania', //Australia Eastern Standard Time |
||
18 | 'AWST' => 'Australia/West', //Australia Western Standard Time |
||
19 | 'WITA' => 'Asia/Makassar', |
||
20 | 'AEDT' => 'Australia/Sydney', //Australia Eastern Daylight Time |
||
21 | 'ACDT' => '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($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 | * @throws \InvalidArgumentException Thrown if $gmtOffset is not an integer. |
||
54 | * @throws \InvalidArgumentException Thrown if $isDaylightSavings is not a boolean. |
||
55 | */ |
||
56 | final public static function fromOffset($gmtOffset, $isDaylightSavings) |
||
68 | |||
69 | /** |
||
70 | * Returns the long name of the given \DateTimeZone. |
||
71 | * |
||
72 | * @param \DateTimeZone $timezone The timezone object from which the long name should be obtained. |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | final public static function getLongName(\DateTimeZone $timezone) |
||
87 | } |
||
88 |