public function Timestamp::getDateTime in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/Timestamp.php \Drupal\Core\TypedData\Plugin\DataType\Timestamp::getDateTime()
Returns the date time object.
Return value
\Drupal\Core\Datetime\DrupalDateTime|null A date object or NULL if there is no date.
Overrides DateTimeInterface::getDateTime
File
- core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ Timestamp.php, line 28
Class
- Timestamp
- The timestamp data type.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function getDateTime() {
if (isset($this->value)) {
return DrupalDateTime::createFromTimestamp($this->value);
}
}