DateTimeNormalizer::$allowedFormats

Same name in other branches
  1. 8.9.x core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::allowedFormats
  2. 10 core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::allowedFormats
  3. 11.x core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::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[]

See also

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

File

core/modules/serialization/src/Normalizer/DateTimeNormalizer.php, line 27

Class

DateTimeNormalizer
Converts values for datetime objects to RFC3339 and from common formats.

Namespace

Drupal\serialization\Normalizer

Code

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

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