39 static public function setDefaultTimezoneFromConfig ()
44 if ($config->get_cfg_value(
'timezone') !=
'') {
45 $tz = $config->get_cfg_value(
'timezone');
47 if (@date_default_timezone_set($tz)) {
52 _(
'The timezone setting "%s" in your configuration is not valid.'),
68 static public function get_default_timezone ($stamp = NULL)
73 if ($stamp === NULL) {
78 if (static::setDefaultTimezoneFromConfig()) {
79 $tz = $config->get_cfg_value(
'timezone');
80 $tz_delta = date(
'Z', $stamp);
81 $tz_delta = $tz_delta / 3600;
82 return [
'name' => $tz,
'value' => $tz_delta];
84 return [
'name' =>
'unconfigured',
'value' => 0];
93 static public function _get_tz_zones ()
95 return DateTimeZone::listIdentifiers();
99 static public function getDefaultTimeZone ()
101 return new DateTimeZone(date_default_timezone_get());
105 static public function utc ()
109 $utc =
new DateTimeZone(
'UTC');
htmlescape(string $str)
Escape string for HTML output.
This class contains all the function needed to manage the timezones.
Parent class for all errors in FusionDirectory.