DateTimeValidator

class DateTimeValidator extends DateValidator Constants PRETTY_DATE Whether to format {@link \DateTime} objects as RFC-3339 dates ("Y-m-d H:i:s"). OBJECT_TO_STRING Whether to cast objects with a "__toString()" method to strings. PATTERN Methods initialize(ExecutionContextInterface $context) Initializes the constraint validator. from ConstraintValidator static bool checkDate(int $year, int $month, int $day) Checks whether a date is valid. from DateValidator validate(mixe

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::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::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

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

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

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

class DateTimeToRfc3339Transformer extends BaseDateTimeTransformer Methods __construct(string $inputTimezone = null, string $outputTimezone = null) Constructor. from BaseDateTimeTransformer mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date. mixed reverseTransform(string $rfc3339) Transforms a formatted string following RFC 3339 into a normalized date. Details __construct(string $inputTimezone = null, st

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