| @@ 124-134 (lines=11) @@ | ||
| 121 | * |
|
| 122 | * @return \DateTimeZone |
|
| 123 | */ |
|
| 124 | public static function getDefaultTimeZone() |
|
| 125 | { |
|
| 126 | if (null === static::$defaultTimeZone) { |
|
| 127 | $tz = \Xoops::getInstance()->getConfig('default_TZ'); |
|
| 128 | if (is_numeric($tz)) { |
|
| 129 | $tz = 'UTC'; |
|
| 130 | } |
|
| 131 | static::$defaultTimeZone = static::newDateTimeZone($tz); |
|
| 132 | } |
|
| 133 | return static::$defaultTimeZone; |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * Get the server timezone as set in server_TZ config |
|
| @@ 141-151 (lines=11) @@ | ||
| 138 | * |
|
| 139 | * @return \DateTimeZone |
|
| 140 | */ |
|
| 141 | public static function getSystemTimeZone() |
|
| 142 | { |
|
| 143 | if (null === static::$systemTimeZone) { |
|
| 144 | $tz = \Xoops::getInstance()->getConfig('server_TZ'); |
|
| 145 | if (is_numeric($tz)) { |
|
| 146 | $tz = 'UTC'; |
|
| 147 | } |
|
| 148 | static::$systemTimeZone = static::newDateTimeZone($tz); |
|
| 149 | } |
|
| 150 | return static::$systemTimeZone; |
|
| 151 | } |
|
| 152 | ||
| 153 | /** |
|
| 154 | * @param string $name Name of language file to be loaded, without extension |
|