You are here

public static function CommonDataConverter::dateIso8601Value in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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.

4 string references to 'CommonDataConverter::dateIso8601Value'
rdf.mapping.comment.comment.yml in core/profiles/standard/config/install/rdf.mapping.comment.comment.yml
core/profiles/standard/config/install/rdf.mapping.comment.comment.yml
rdf.mapping.node.article.yml in core/profiles/standard/config/install/rdf.mapping.node.article.yml
core/profiles/standard/config/install/rdf.mapping.node.article.yml
rdf.mapping.node.forum.yml in core/modules/forum/config/optional/rdf.mapping.node.forum.yml
core/modules/forum/config/optional/rdf.mapping.node.forum.yml
rdf.mapping.node.page.yml in core/profiles/standard/config/install/rdf.mapping.node.page.yml
core/profiles/standard/config/install/rdf.mapping.node.page.yml

File

core/modules/rdf/src/CommonDataConverter.php, line 36
Contains \Drupal\rdf\CommonDataConverter.

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');
}