public function TimeZoneResolver::setDefaultTimeZone in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/src/TimeZoneResolver.php \Drupal\system\TimeZoneResolver::setDefaultTimeZone()
- 9 core/modules/system/src/TimeZoneResolver.php \Drupal\system\TimeZoneResolver::setDefaultTimeZone()
Sets the default time zone.
File
- core/
modules/ system/ src/ TimeZoneResolver.php, line 52
Class
- TimeZoneResolver
- Event handler that resolves time zone based on site and user configuration.
Namespace
Drupal\systemCode
public function setDefaultTimeZone() {
if ($time_zone = $this
->getTimeZone()) {
date_default_timezone_set($time_zone);
}
}