You are here

function date_iso8601 in Drupal 8

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

Returns an ISO8601 formatted date based on the given date.


string $date: A UNIX timestamp.

Return value

string An ISO8601 formatted date.


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

See also

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.


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


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