Creates a date when none of the other methods are appropriate.
Fallback construction for values that don't match any of the other patterns. Lets the parent dateTime attempt to turn this string into a valid date.
protected function constructFallback() {
try {
// One last test for invalid input before we try to construct
// a date. If the input contains totally bogus information
// it will blow up badly if we pass it to the constructor.
// The date_parse() function will tell us if the input
// makes sense.
if (!empty($this->inputTimeAdjusted)) {
$test = date_parse($this->inputTimeAdjusted);
if (!empty($test['errors'])) {
$this->errors[] = $test['errors'];
}
}
if (empty($this->errors)) {
parent::__construct($this->inputTimeAdjusted, $this->inputTimeZoneAdjusted);
}
} catch (\Exception $e) {
$this->errors[] = $e
->getMessage();
}
}