TimeStampItemNormalizerTrait::$allowedFormats

Allowed timestamps formats for the denormalizer.

The denormalizer allows deserialization to timestamps from three different formats. Validation of the input data and creation of the numerical timestamp value is handled with \DateTime::createFromFormat(). The list is chosen to be unambiguous and language neutral, but also common for data interchange.

Type: string[]

See also

http://php.net/manual/datetime.createfromformat.php

File

core/modules/serialization/src/Normalizer/TimeStampItemNormalizerTrait.php, line 29

Class

TimeStampItemNormalizerTrait
A trait for TimestampItem normalization functionality.

Namespace

Drupal\serialization\Normalizer

Code

protected $allowedFormats = [
    'UNIX timestamp' => 'U',
    'ISO 8601' => \DateTime::ISO8601,
    'RFC 3339' => \DateTime::RFC3339,
];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.