You are here

protected property TimeStampItemNormalizerTrait::$allowedFormats in Drupal 8

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,
];