Fix deprecated null for DateTime in PHP 8.1 (#5843)

This commit is contained in:
Yuriy Bakhtin 2022-08-15 13:33:24 +03:00 committed by GitHub
parent 4dd841d1a7
commit 0781c83cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ class DbDateValidator extends DateValidator
$this->addError($model, $attribute, $this->tooBig, ['max' => $this->maxString]);
} else {
// If there is no error, and attribute is not yet in DB Format - convert to DB
$date = new \DateTime(null, new \DateTimeZone('UTC'));
$date = new \DateTime('now', new \DateTimeZone('UTC'));
$date->setTimestamp($timestamp);
if ($timeValue) {