You are here

public static function CommonDataConverter::dateIso8601Value in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rdf/src/CommonDataConverter.php \Drupal\rdf\CommonDataConverter::dateIso8601Value()
  2. 9 core/modules/rdf/src/CommonDataConverter.php \Drupal\rdf\CommonDataConverter::dateIso8601Value()

Converts a date entity field array into an ISO 8601 timestamp string.

Parameters

array $data: The array containing the 'value' element.

Return value

string Returns the ISO 8601 timestamp.

5 string references to 'CommonDataConverter::dateIso8601Value'
d7_rdf_mapping.yml in core/modules/rdf/migrations/d7_rdf_mapping.yml
core/modules/rdf/migrations/d7_rdf_mapping.yml
rdf.mapping.comment.comment.yml in core/modules/rdf/config/optional/rdf.mapping.comment.comment.yml
core/modules/rdf/config/optional/rdf.mapping.comment.comment.yml
rdf.mapping.node.article.yml in core/modules/rdf/config/optional/rdf.mapping.node.article.yml
core/modules/rdf/config/optional/rdf.mapping.node.article.yml
rdf.mapping.node.forum.yml in core/modules/rdf/config/optional/rdf.mapping.node.forum.yml
core/modules/rdf/config/optional/rdf.mapping.node.forum.yml
rdf.mapping.node.page.yml in core/modules/rdf/config/optional/rdf.mapping.node.page.yml
core/modules/rdf/config/optional/rdf.mapping.node.page.yml

File

core/modules/rdf/src/CommonDataConverter.php, line 32

Class

CommonDataConverter
Contains methods for common data conversions.

Namespace

Drupal\rdf

Code

public static function dateIso8601Value($data) {
  return \Drupal::service('date.formatter')
    ->format($data['value'], 'custom', 'c', 'UTC');
}