From 28b5b803be5570397d6db605f5547d3c6b9fdd5a Mon Sep 17 00:00:00 2001 From: David Peck Date: Sat, 5 Jun 2021 16:46:19 +1200 Subject: [PATCH] FIX Defensively copy mocked datetime --- src/ORM/FieldType/DBDatetime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/FieldType/DBDatetime.php b/src/ORM/FieldType/DBDatetime.php index e20492e21fc..f4859635fa1 100644 --- a/src/ORM/FieldType/DBDatetime.php +++ b/src/ORM/FieldType/DBDatetime.php @@ -173,7 +173,7 @@ public static function now() /** @var DBDatetime $now */ $now = null; if (self::$mock_now) { - $now = self::$mock_now; + $now = DBField::create_field('Datetime', self::$mock_now->Value); } else { $now = DBField::create_field('Datetime', time()); }