| Methods |
public
|
__construct(string $inputTimezone = null, string $outputTimezone = null, string $format = 'H:i:s')
Transforms a \DateTime instance to a string.
Transforms a \DateTime instance to a string.
Parameters
| $inputTimezone |
The name of the input timezone
|
| $outputTimezone |
The name of the output timezone
|
| $format |
The date format
|
Throws
TIC\FormBundle\Form\DataTransformer\UnexpectedTypeException |
if a timezone is not a string
|
|
#
|
public
|
reverseTransform(DateTimeInterface $dateTime): string
Transforms a DateTime object into a time string with the configured format
and timezone.
Transforms a DateTime object into a time string with the configured format
and timezone.
Parameters
| $dateTime |
A DateTimeInterface object
|
Returns
A value as produced by PHP's date() function
Throws
Symfony\Component\Form\Exception\TransformationFailedException |
If the given value is not a \DateTimeInterface
|
|
#
|
public
|
transform(string $value): DateTime|null
Transforms a time string in the configured timezone into a DateTime object.
Transforms a time string in the configured timezone into a DateTime object.
Parameters
| $value |
A value as produced by PHP's date() function
|
Returns
Throws
Symfony\Component\Form\Exception\TransformationFailedException |
If the given value is not a string,
or could not be transformed
|
|
#
|