You are here

public function DateTimeNormalizer::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::__construct()

Constructs a new DateTimeNormalizer instance.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

File

core/modules/serialization/src/Normalizer/DateTimeNormalizer.php, line 50

Class

DateTimeNormalizer
Converts values for datetime objects to RFC3339 and from common formats.

Namespace

Drupal\serialization\Normalizer

Code

public function __construct(ConfigFactoryInterface $config_factory) {
  $this->systemDateConfig = $config_factory
    ->get('system.date');
}