protected function DateTimePlus::constructFromObject

Creates a date object from an input date object.

1 call to DateTimePlus::constructFromObject()
DateTimePlus::__construct in drupal/core/lib/Drupal/Component/Datetime/DateTimePlus.php
Constructs a date object set to a requested date and timezone.

File

drupal/core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 299
Definition of Drupal\Component\Datetime\DateTimePlus

Class

DateTimePlus
Extends DateTime().

Namespace

Drupal\Component\Datetime

Code

protected function constructFromObject() {
  try {
    $this->inputTimeAdjusted = $this->inputTimeAdjusted
      ->format(static::FORMAT);
    parent::__construct($this->inputTimeAdjusted, $this->inputTimeZoneAdjusted);
  } catch (\Exception $e) {
    $this->errors[] = $e
      ->getMessage();
  }
}