DateTimeType::buildForm()

buildForm(FormBuilderInterface $builder, array $options) Builds the form. This method is called for each type in the hierarchy starting from the top most type. Type extensions can further modify the form. Parameters FormBuilderInterface $builder The form builder array $options The options

DateTimeType

class DateTimeType extends AbstractType Constants DEFAULT_DATE_FORMAT DEFAULT_TIME_FORMAT HTML5_FORMAT This is not quite the HTML5 format yet, because ICU lacks the capability of parsing and generating RFC 3339 dates, which are like the below pattern but with a timezone suffix. The timezone suffix is. "Z" for UTC "(-|+)HH:mm" for other timezones (note the colon!) For more information see: http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax http://www.w

DateTimeToTimestampTransformer::transform()

mixed transform(DateTimeInterface $dateTime) Transforms a DateTime object into a timestamp in the configured timezone. Parameters DateTimeInterface $dateTime A DateTimeInterface object Return Value mixed The value in the transformed representation Exceptions TransformationFailedException If the given value is not a \DateTimeInterface

DateTimeToTimestampTransformer::reverseTransform()

mixed reverseTransform(mixed $value) Transforms a timestamp in the configured timezone into a DateTime object. Parameters mixed $value The value in the transformed representation Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not a timestamp or if the given timestamp is invalid

DateTimeToTimestampTransformer

class DateTimeToTimestampTransformer extends BaseDateTimeTransformer Transforms between a timestamp and a DateTime object. Methods __construct(string $inputTimezone = null, string $outputTimezone = null) Constructor. 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. Det

DateTimeToStringTransformer::transform()

mixed transform(DateTimeInterface $dateTime) Transforms a DateTime object into a date string with the configured format and timezone. Parameters DateTimeInterface $dateTime A DateTimeInterface object Return Value mixed The value in the transformed representation Exceptions TransformationFailedException If the given value is not a \DateTimeInterface

DateTimeToStringTransformer::reverseTransform()

mixed reverseTransform(mixed $value) Transforms a date string in the configured timezone into a DateTime object. Parameters mixed $value The value in the transformed representation Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not a string, or could not be transformed

DateTimeToStringTransformer

class DateTimeToStringTransformer extends BaseDateTimeTransformer Transforms between a date string and a DateTime object. Methods __construct(string $inputTimezone = null, string $outputTimezone = null, string $format = 'Y-m-d H:i:s', bool $parseUsingPipe = true) Transforms a \DateTime instance to a string. mixed transform(DateTimeInterface $dateTime) Transforms a DateTime object into a date string with the configured format and timezone. mixed reverseTransform(mixed $value) Tr

DateTimeToRfc3339Transformer::transform()

mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date. Parameters DateTimeInterface $dateTime A DateTimeInterface object Return Value mixed The value in the transformed representation Exceptions TransformationFailedException If the given value is not a \DateTimeInterface

DateTimeToRfc3339Transformer::reverseTransform()

mixed reverseTransform(string $rfc3339) Transforms a formatted string following RFC 3339 into a normalized date. Parameters string $rfc3339 Formatted string Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not a string, if the value could not be transformed