You are here

class DateTime in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-stdlib/src/DateTime.php \Zend\Stdlib\DateTime
  2. 8 vendor/symfony/validator/Constraints/DateTime.php \Symfony\Component\Validator\Constraints\DateTime
  3. 8 core/lib/Drupal/Core/Datetime/Element/Datetime.php \Drupal\Core\Datetime\Element\Datetime
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/DateTime.php \Zend\Stdlib\DateTime

DateTime

An extension of the \DateTime object.

Hierarchy

Expanded class hierarchy of DateTime

12 string references to 'DateTime'
AbstractComparisonValidatorTestCase::addPhp5Dot5Comparisons in vendor/symfony/validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
Debug::export in vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php
DebugTest::testExportDateTime in vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php
EqualToValidatorTest::provideInvalidComparisons in vendor/symfony/validator/Tests/Constraints/EqualToValidatorTest.php
GreaterThanOrEqualValidatorTest::provideInvalidComparisons in vendor/symfony/validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php

... See full list

File

vendor/zendframework/zend-stdlib/src/DateTime.php, line 23

Namespace

Zend\Stdlib
View source
class DateTime extends \DateTime {

  /**
   * The DateTime::ISO8601 constant used by php's native DateTime object does
   * not allow for fractions of a second. This function better handles ISO8601
   * formatted date strings.
   *
   * @param  string       $time
   * @param  DateTimeZone $timezone
   * @return mixed
   */
  public static function createFromISO8601($time, DateTimeZone $timezone = null) {
    $format = self::ISO8601;
    if (isset($time[19]) && $time[19] === '.') {
      $format = 'Y-m-d\\TH:i:s.uO';
    }
    if ($timezone !== null) {
      return self::createFromFormat($format, $time, $timezone);
    }
    return self::createFromFormat($format, $time);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DateTime::createFromISO8601 public static function The DateTime::ISO8601 constant used by php's native DateTime object does not allow for fractions of a second. This function better handles ISO8601 formatted date strings. Overrides DateTime::createFromISO8601 1