function Timestamp::getDateTime

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/Timestamp.php \Drupal\Core\TypedData\Plugin\DataType\Timestamp::getDateTime()
  2. 8.9.x core/lib/Drupal/Core/TypedData/Plugin/DataType/Timestamp.php \Drupal\Core\TypedData\Plugin\DataType\Timestamp::getDateTime()
  3. 11.x core/lib/Drupal/Core/TypedData/Plugin/DataType/Timestamp.php \Drupal\Core\TypedData\Plugin\DataType\Timestamp::getDateTime()

Overrides DateTimeInterface::getDateTime

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/Timestamp.php, line 29

Class

Timestamp
The timestamp data type.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function getDateTime() {
    if (isset($this->value)) {
        return DrupalDateTime::createFromTimestamp($this->value);
    }
}

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