Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::units
  2. 9 core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::units

Contains the different date interval units.

This array is keyed by strings representing the unit (e.g. '@count year|@count years') and with the amount of values of the unit in seconds.

Type: array

File

core/lib/Drupal/Core/Datetime/DateFormatter.php, line 68

Class

DateFormatter
Provides a service to handle various date related functionality.

Namespace

Drupal\Core\Datetime

Code

protected $units = [
  '@count year|@count years' => 31536000,
  '@count month|@count months' => 2592000,
  '@count week|@count weeks' => 604800,
  '@count day|@count days' => 86400,
  '@count hour|@count hours' => 3600,
  '@count min|@count min' => 60,
  '@count sec|@count sec' => 1,
];