Core\DataTransformer\DateTimeToTimestampTransformer (Component\Form\Extension)
Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer
class DateTimeToTimestampTransformer extends BaseDateTimeTransformer
Transforms between a timestamp and a DateTime object.
Methods
__construct(string $inputTimezone = null, string $outputTimezone = null) Constructor. | from BaseDateTimeTransformer | |
int | transform(mixed $value) Transforms a DateTime object into a timestamp in the configured timezone. | |
DateTime | reverseTransform(string $value) Transforms a timestamp in the configured timezone into a DateTime object. |
Details
public __construct(string $inputTimezone = null, string $outputTimezone = null)
Constructor.
public int transform(mixed $value)
Transforms a DateTime object into a timestamp in the configured timezone.
public DateTime reverseTransform(string $value)
Transforms a timestamp in the configured timezone into a DateTime object.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.html