public function Timestamp::getDateTime in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 33 - Contains \Drupal\Core\TypedData\Plugin\DataType\Timestamp.
Class
- Timestamp
- The timestamp data type.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function getDateTime() {
if ($this->value) {
return DrupalDateTime::createFromTimestamp($this->value);
}
}