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
CloneableFinalInstantiable
Constants |
public Symfony |
public Symfony |
public Symfony |
Methods |
public __construct(array $defaultContext = []) |
public denormalize(?mixed $data, string $type, ?string $format = NULL, array $context = []) : DateTimeInterface
|
public getSupportedTypes(?string $format) : array |
public normalize(?mixed $object, ?string $format = NULL, array $context = []) : string|int|float
|
public setDefaultContext(array $defaultContext) : void |
public supportsDenormalization(?mixed $data, string $type, ?string $format = NULL, array $context = []) : bool |
public supportsNormalization(?mixed $data, ?string $format = NULL, array $context = []) : bool |
Constants |
private Symfony |
Properties |
private array $defaultContext = ['datetime_format' => 'Y-m-d\TH:i:sP', 'datetime_timezone' => NULL, 'datetime_cast' => NULL] |
Methods |
private formatDateTimeErrors(array $errors) : array Formats datetime errors.
|
private getTimezone(array $context) : ?DateTimeZone |