You are here

public function FormattedDateDiff::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Datetime/FormattedDateDiff.php \Drupal\Core\Datetime\FormattedDateDiff::__construct()

Creates a new FormattedDateDiff instance.

Parameters

string $string: The formatted time difference.

int $max_age: The maximum time in seconds that this string may be cached.

File

core/lib/Drupal/Core/Datetime/FormattedDateDiff.php, line 41

Class

FormattedDateDiff
Contains a formatted time difference.

Namespace

Drupal\Core\Datetime

Code

public function __construct($string, $max_age) {
  $this->string = $string;
  $this->maxAge = $max_age;
}