diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 25846ef42f..4c146e058f 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -6432,7 +6432,11 @@ class AttributeDateTime extends AttributeDBField { $sDefaultValue = $this->Get('default_value'); if (utils::IsNotNullOrEmptyString($sDefaultValue)) { - $oDate = new DateTimeImmutable(Expression::FromOQL($sDefaultValue)->Evaluate([])); + try { + $oDate = new DateTimeImmutable($sDefaultValue); + } catch (Exception $e) { + $oDate = new DateTimeImmutable(Expression::FromOQL($sDefaultValue)->Evaluate([])); + } return $oDate->format($this->GetInternalFormat()); } return $this->GetNullValue();