Copied!

Normalizes an object implementing the {@see \DateTimeInterface} to a date string.

Denormalizes a date string to an instance of {@see \DateTime} or {@see \DateTimeImmutable}.

CloneableInstantiable
Constants
public Symfony\Component\Serializer\Normalizer\DenormalizerInterface::COLLECT_DENORMALIZATION_ERRORS = 'collect_denormalization_errors'
public Symfony\Component\Serializer\Normalizer\DateTimeNormalizer::FORMAT_KEY = 'datetime_format'
public Symfony\Component\Serializer\Normalizer\DateTimeNormalizer::TIMEZONE_KEY = 'datetime_timezone'
Methods
public __construct(array $defaultContext = [])
public denormalize(?mixed $data, string $type, ?string $format = NULL, array $context = []) : DateTimeInterface
public hasCacheableSupportsMethod() : bool
public normalize(?mixed $object, ?string $format = NULL, array $context = []) : string
public setDefaultContext(array $defaultContext) : void
public supportsDenormalization(?mixed $data, string $type, ?string $format = NULL) : bool
public supportsNormalization(?mixed $data, ?string $format = NULL) : bool
Constants
private Symfony\Component\Serializer\Normalizer\DateTimeNormalizer::SUPPORTED_TYPES = ['DateTimeInterface' => true, 'DateTimeImmutable' => true, 'DateTime' => true]
Properties
private $defaultContext
Methods
private formatDateTimeErrors(array $errors) : array
 

Formats datetime errors.

private getTimezone(array $context) : ?DateTimeZone
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration