1 | <?php |
||
9 | abstract class DateTimeZone |
||
10 | { |
||
11 | /** |
||
12 | * Array of edge case timezones |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | private static $outliers = [ |
||
17 | 'WIB' => 'Asia/Jakarta', //Western Indonesian Time |
||
18 | 'FET' => 'Europe/Helsinki', //Further-eastern European Time |
||
19 | 'AEST' => 'Australia/Tasmania', //Australia Eastern Standard Time |
||
20 | 'AWST' => 'Australia/West', //Australia Western Standard Time |
||
21 | 'WITA' => 'Asia/Makassar', |
||
22 | 'AEDT' => 'Australia/Sydney', //Australia Eastern Daylight Time |
||
23 | 'ACDT' => 'Australia/Adelaide', //Australia Central Daylight Time |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * Returns a \DateTimeZone instance for the give nameOrAbbreviation. |
||
28 | * |
||
29 | * @param string $nameOrAbbreviation The timezone nameOrAbbreviation. |
||
30 | * @param \DateTimeZone $default The default timezone to return if none can be created. |
||
31 | * |
||
32 | * @return \DateTimeZone |
||
33 | */ |
||
34 | final public static function fromString($nameOrAbbreviation, \DateTimeZone $default = null) |
||
38 | |||
39 | /** |
||
40 | * Returns a \DateTimeZone object based on gmt offset. |
||
41 | * |
||
42 | * @param integer $gmtOffset Offset from GMT in seconds. |
||
43 | * @param boolean $isDaylightSavings Daylight saving time indicator. |
||
44 | * |
||
45 | * @return \DateTimeZone |
||
46 | * |
||
47 | * @throws \InvalidArgumentException Thrown if $gmtOffset is not an integer. |
||
48 | * @throws \InvalidArgumentException Thrown if $isDaylightSavings is not a boolean. |
||
49 | */ |
||
50 | final public static function fromOffset($gmtOffset, $isDaylightSavings) |
||
62 | |||
63 | /** |
||
64 | * Returns the long name of the given \DateTimeZone. |
||
65 | * |
||
66 | * @param \DateTimeZone $timezone The timezone object from which the long name should be obtained. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | final public static function getLongName(\DateTimeZone $timezone) |
||
74 | } |
||
75 |