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, string $outputTimezone = null)

Constructor.

Parameters

string $inputTimezone The name of the input timezone
string $outputTimezone The name of the output timezone

Exceptions

UnexpectedTypeException if a timezone is not a string
InvalidArgumentException if a timezone is not valid

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

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
doc_Symfony
2016-10-28 06:13:10
Comments
Leave a Comment

Please login to continue.