protected function DateTimeNormalizer::getNormalizationTimezone in Drupal 9
Same name and namespace in other branches
- 8 core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::getNormalizationTimezone()
Gets the timezone to be used during normalization.
@returns \DateTimeZone The timezone to use.
See also
::normalize
\Drupal\Core\Datetime\DrupalDateTime::prepareTimezone()
1 method overrides DateTimeNormalizer::getNormalizationTimezone()
- TimestampNormalizer::getNormalizationTimezone in core/
modules/ serialization/ src/ Normalizer/ TimestampNormalizer.php - Gets the timezone to be used during normalization.
File
- core/
modules/ serialization/ src/ Normalizer/ DateTimeNormalizer.php, line 80
Class
- DateTimeNormalizer
- Converts values for datetime objects to RFC3339 and from common formats.
Namespace
Drupal\serialization\NormalizerCode
protected function getNormalizationTimezone() {
$default_site_timezone = $this->systemDateConfig
->get('timezone.default');
return new \DateTimeZone($default_site_timezone);
}