function DateTimeInterface::setDateTime

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php \Drupal\Core\TypedData\Type\DateTimeInterface::setDateTime()
  2. 10 core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php \Drupal\Core\TypedData\Type\DateTimeInterface::setDateTime()
  3. 11.x core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php \Drupal\Core\TypedData\Type\DateTimeInterface::setDateTime()

Sets the date time object.

Parameters

\Drupal\Core\Datetime\DrupalDateTime $dateTime: An instance of a date time object.

2 methods override DateTimeInterface::setDateTime()
DateTimeIso8601::setDateTime in core/lib/Drupal/Core/TypedData/Plugin/DataType/DateTimeIso8601.php
Sets the date time object.
Timestamp::setDateTime in core/lib/Drupal/Core/TypedData/Plugin/DataType/Timestamp.php
Sets the date time object.

File

core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php, line 28

Class

DateTimeInterface
Interface for dates, optionally including a time.

Namespace

Drupal\Core\TypedData\Type

Code

public function setDateTime(DrupalDateTime $dateTime);

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