mediatekformation

DateTimeToRfc3339Transformer extends BaseDateTimeTransformer
in package

Tags
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

$formats  : mixed
$inputTimezone  : mixed
$outputTimezone  : mixed
__construct()  : mixed
reverseTransform()  : DateTime|null
Transforms a formatted string following RFC 3339 into a normalized date.
transform()  : string
Transforms a normalized date into a localized date.

Properties

$formats

protected static mixed $formats = [\IntlDateFormatter::NONE, \IntlDateFormatter::FULL, \IntlDateFormatter::LONG, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT]

Methods

__construct()

public __construct([string|null $inputTimezone = null ][, string|null $outputTimezone = null ]) : mixed
Parameters
$inputTimezone : string|null = null

The name of the input timezone

$outputTimezone : string|null = null

The name of the output timezone

Tags
throws
InvalidArgumentException

if a timezone is not valid

Return values
mixed

reverseTransform()

Transforms a formatted string following RFC 3339 into a normalized date.

public reverseTransform(string $rfc3339) : DateTime|null
Parameters
$rfc3339 : string

Formatted string

Tags
throws
TransformationFailedException

If the given value is not a string, if the value could not be transformed

Return values
DateTime|null

Normalized date

transform()

Transforms a normalized date into a localized date.

public transform(DateTimeInterface $dateTime) : string
Parameters
$dateTime : DateTimeInterface

A DateTimeInterface object

Tags
throws
TransformationFailedException

If the given value is not a \DateTimeInterface

Return values
string

The formatted date

Search results