template_preprocess_time

function template_preprocess_time

template_preprocess_time(&$variables)

Prepares variables for time templates.

Default template: time.html.twig.

Parameters

array $variables: An associative array possibly containing:

  • attributes['timestamp']:
  • timestamp:
  • text:

File

core/includes/theme.inc, line 509
The theme system, which controls the output of Drupal.

Code

function template_preprocess_time(&$variables) {
  // Format the 'datetime' attribute based on the timestamp.
  // @see http://www.w3.org/TR/html5-author/the-time-element.h