Skip to content

Commit 64bac60

Browse files
IBX-801: Fixed timezone for DateTime fields in content name pattern
1 parent 3922c71 commit 64bac60

File tree

1 file changed

+4
-1
lines changed
  • eZ/Publish/Core/FieldType/DateAndTime

1 file changed

+4
-1
lines changed

eZ/Publish/Core/FieldType/DateAndTime/Value.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ public static function fromString($dateString)
6666
public static function fromTimestamp($timestamp)
6767
{
6868
try {
69-
return new static(new DateTime("@{$timestamp}"));
69+
$dateTime = new DateTime();
70+
$dateTime->setTimestamp($timestamp);
71+
72+
return new static($dateTime);
7073
} catch (Exception $e) {
7174
throw new InvalidArgumentValue('$timestamp', $timestamp, __CLASS__, $e);
7275
}

0 commit comments

Comments
 (0)