DateTimeNormalizer
class DateTimeNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface
Normalizes an object implementing the {see \DateTimeInterface} to a date string.
Denormalizes a date string to an instance of {see \DateTime} or {see \DateTimeImmutable}.
Constants
FORMAT_KEY |
|
TIMEZONE_KEY |
|
Methods
Normalizes an object into a set of arrays/scalars.
Checks whether the given class is supported for normalization by this normalizer.
Denormalizes data back into an object of the given class.
Checks whether the given class is supported for denormalization by this normalizer.
No description
Details
array|string|int|float|bool
normalize(mixed $object, string $format = null, array $context = array())
Normalizes an object into a set of arrays/scalars.
bool
supportsNormalization(mixed $data, string $format = null)
Checks whether the given class is supported for normalization by this normalizer.
object
denormalize(mixed $data, string $class, string $format = null, array $context = array())
Denormalizes data back into an object of the given class.