Normalizes an object implementing the {@see \DateTimeInterface} to a date string.
Denormalizes a date string to an instance of {@see \DateTime} or {@see \DateTimeImmutable}.
- author Kévin Dunglas
CloneableInstantiable
Constants |
public Symfony |
public Symfony |
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 |
Properties |
private $defaultContext |
Methods |
private formatDateTimeErrors(array $errors) : array Formats datetime errors. |
private getTimezone(array $context) : ?DateTimeZone |