class DateTimeToTimestampTransformer extends BaseDateTimeTransformer
Transforms between a timestamp and a DateTime object.
static protected | $formats | from BaseDateTimeTransformer | |
protected | $inputTimezone | from BaseDateTimeTransformer | |
protected | $outputTimezone | from BaseDateTimeTransformer |
__construct(string $inputTimezone = null, string $outputTimezone = null) | from BaseDateTimeTransformer | |
mixed | transform(DateTimeInterface $dateTime) Transforms a DateTime object into a timestamp in the configured timezone. | |
mixed | reverseTransform(mixed $value) Transforms a timestamp in the configured timezone into a DateTime object. |
string | $inputTimezone | The name of the input timezone |
string | $outputTimezone | The name of the output timezone |
InvalidArgumentException | if a timezone is not valid |
Transforms a DateTime object into a timestamp in the configured timezone.
DateTimeInterface | $dateTime | A DateTimeInterface object |
mixed | The value in the transformed representation |
TransformationFailedException | If the given value is not a \DateTimeInterface |
Transforms a timestamp in the configured timezone into a DateTime object.
mixed | $value | The value in the transformed representation |
mixed | The value in the original representation |
TransformationFailedException | If the given value is not a timestamp or if the given timestamp is invalid |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.html