DateTimeToArrayTransformer
extends BaseDateTimeTransformer
in package
Transforms between a normalized time and a localized time string/array.
Tags
Table of Contents
- $formats : mixed
- $inputTimezone : mixed
- $outputTimezone : mixed
- $fields : mixed
- $pad : mixed
- $referenceDate : mixed
- __construct() : mixed
- reverseTransform() : DateTime|null
- Transforms a localized date into a normalized date.
- transform() : array<string|int, mixed>
- Transforms a normalized date into a localized date.
Properties
$formats
protected
static mixed
$formats
= [\IntlDateFormatter::NONE, \IntlDateFormatter::FULL, \IntlDateFormatter::LONG, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT]
$inputTimezone
protected
mixed
$inputTimezone
$outputTimezone
protected
mixed
$outputTimezone
$fields
private
mixed
$fields
$pad
private
mixed
$pad
$referenceDate
private
mixed
$referenceDate
Methods
__construct()
public
__construct([string|null $inputTimezone = null ][, string|null $outputTimezone = null ][, array<string|int, string>|null $fields = null ][, bool $pad = false ][, DateTimeInterface $referenceDate = null ]) : mixed
Parameters
- $inputTimezone : string|null = null
-
The input timezone
- $outputTimezone : string|null = null
-
The output timezone
- $fields : array<string|int, string>|null = null
-
The date fields
- $pad : bool = false
-
Whether to use padding
- $referenceDate : DateTimeInterface = null
Return values
mixed —reverseTransform()
Transforms a localized date into a normalized date.
public
reverseTransform(array<string|int, mixed> $value) : DateTime|null
Parameters
- $value : array<string|int, mixed>
-
Localized date
Tags
Return values
DateTime|null —Normalized date
transform()
Transforms a normalized date into a localized date.
public
transform(DateTimeInterface $dateTime) : array<string|int, mixed>
Parameters
- $dateTime : DateTimeInterface
-
A DateTimeInterface object
Tags
Return values
array<string|int, mixed> —Localized date