function 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 29
Class
- Timestamp
- The timestamp data type.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
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.