You are here

protected property TimestampNormalizer::$allowedFormats in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/serialization/src/Normalizer/TimestampNormalizer.php \Drupal\serialization\Normalizer\TimestampNormalizer::allowedFormats

Allowed datetime formats for the denormalizer.

The list is chosen to be unambiguous and language neutral, but also common for data interchange.

Type: string[]

Overrides DateTimeNormalizer::$allowedFormats

See also

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

File

core/modules/serialization/src/Normalizer/TimestampNormalizer.php, line 21

Class

TimestampNormalizer
Converts values for the Timestamp data type to and from common formats.

Namespace

Drupal\serialization\Normalizer

Code

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