DateTimeInterface.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php
  2. 8.9.x core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php
  3. 10 core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php

Namespace

Drupal\Core\TypedData\Type

File

core/lib/Drupal/Core/TypedData/Type/DateTimeInterface.php

View source
<?php

namespace Drupal\Core\TypedData\Type;

use Drupal\Core\Datetime\DrupalDateTime;

/**
 * Interface for dates, optionally including a time.
 *
 * @ingroup typed_data
 */
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);

}

Interfaces

Title Deprecated Summary
DateTimeInterface Interface for dates, optionally including a time.

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