You are here

function date_iso8601 in Drupal 8

Same name and namespace in other branches
  1. 7 includes/common.inc \date_iso8601()

Returns an ISO8601 formatted date based on the given date.

Parameters

string $date: A UNIX timestamp.

Return value

string An ISO8601 formatted date.

Deprecated

in drupal:8.7.0 and is removed from drupal:9.0.0. Use date('c', $date) instead.

See also

https://www.drupal.org/node/2999991

Related topics

1 string reference to 'date_iso8601'
RdfMappingTest::providerSource in core/modules/rdf/tests/src/Kernel/Plugin/migrate/source/d7/RdfMappingTest.php
The data provider.

File

core/includes/common.inc, line 351
Common functions that many Drupal modules will need to reference.

Code

function date_iso8601($date) {
  @trigger_error('date_iso8601() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use date("c", $date) instead. See https://www.drupal.org/node/2999991.', E_USER_DEPRECATED);

  // The DATE_ISO8601 constant cannot be used here because it does not match
  // date('c') and produces invalid RDF markup.
  return date('c', $date);
}