From 00783263b5b89faea6fa9f5744b405053502c9ba Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Wed, 21 Jul 2021 12:46:29 +0100 Subject: [PATCH] IBX-801: Fixed timezone for DateTime fields in content name pattern --- eZ/Publish/Core/FieldType/DateAndTime/Value.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eZ/Publish/Core/FieldType/DateAndTime/Value.php b/eZ/Publish/Core/FieldType/DateAndTime/Value.php index 0174570408..702f8e9941 100644 --- a/eZ/Publish/Core/FieldType/DateAndTime/Value.php +++ b/eZ/Publish/Core/FieldType/DateAndTime/Value.php @@ -66,7 +66,10 @@ public static function fromString($dateString) public static function fromTimestamp($timestamp) { try { - return new static(new DateTime("@{$timestamp}")); + $dateTime = new DateTime(); + $dateTime->setTimestamp($timestamp); + + return new static($dateTime); } catch (Exception $e) { throw new InvalidArgumentValue('$timestamp', $timestamp, __CLASS__, $e); }