Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php \Drupal\Core\TypedData\Type\DateTimeInterface
- 9 core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php \Drupal\Core\TypedData\Type\DateTimeInterface
Interface for dates, optionally including a time.
Hierarchy
- interface \Drupal\Core\TypedData\Type\DateTimeInterface
Expanded class hierarchy of DateTimeInterface
All classes that implement DateTimeInterface
Related topics
5 files declare their use of DateTimeInterface
- DateTimeIso8601NormalizerTest.php in core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ DateTimeIso8601NormalizerTest.php - DateTimeNormalizerTest.php in core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ DateTimeNormalizerTest.php - PrimitiveTypeConstraintValidator.php in core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ PrimitiveTypeConstraintValidator.php - TimestampNormalizerTest.php in core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ TimestampNormalizerTest.php - TypedDataTest.php in core/
tests/ Drupal/ KernelTests/ Core/ TypedData/ TypedDataTest.php
File
- core/
lib/ Drupal/ Core/ TypedData/ Type/ DateTimeInterface.php, line 12
Namespace
Drupal\Core\TypedData\TypeView source
interface DateTimeInterface {
/**
* Returns the date time object.
*
* @return \Drupal\Core\Datetime\DrupalDateTime|null
* A date object or NULL if there is no date.
*/
public function getDateTime();
/**
* Sets the date time object.
*
* @param \Drupal\Core\Datetime\DrupalDateTime $dateTime
* An instance of a date time object.
*/
public function setDateTime(DrupalDateTime $dateTime);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DateTimeInterface:: |
public | function | Returns the date time object. | |
DateTimeInterface:: |
public | function | Sets the date time object. |