public function DateTimeIso8601::setDateTime in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/TypedData/Plugin/DataType/DateTimeIso8601.php \Drupal\Core\TypedData\Plugin\DataType\DateTimeIso8601::setDateTime()
Sets the date time object.
Parameters
\Drupal\Core\Datetime\DrupalDateTime $dateTime: An instance of a date time object.
Overrides DateTimeInterface::setDateTime
File
- core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ DateTimeIso8601.php, line 43 - Contains \Drupal\Core\TypedData\Plugin\DataType\DateTimeIso8601.
Class
- DateTimeIso8601
- A data type for ISO 8601 date strings.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function setDateTime(DrupalDateTime $dateTime, $notify = TRUE) {
$this->value = $dateTime
->format('c');
// Notify the parent of any changes.
if ($notify && isset($this->parent)) {
$this->parent
->onChange($this->name);
}
}