function FormattedDateDiff::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Datetime/FormattedDateDiff.php \Drupal\Core\Datetime\FormattedDateDiff::__construct()
  2. 10 core/lib/Drupal/Core/Datetime/FormattedDateDiff.php \Drupal\Core\Datetime\FormattedDateDiff::__construct()
  3. 9 core/lib/Drupal/Core/Datetime/FormattedDateDiff.php \Drupal\Core\Datetime\FormattedDateDiff::__construct()
  4. 8.9.x 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 $maxAge: The maximum time in seconds that this string may be cached.

File

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

Class

FormattedDateDiff
Contains a formatted time difference.

Namespace

Drupal\Core\Datetime

Code

public function __construct(protected $string, protected $maxAge) {
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.