Skip to content

Commit

Permalink
IBX-801: Fixed timezone for DateTime fields in content name pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
SerheyDolgushev committed Jul 21, 2021
1 parent 9cedd02 commit 0078326
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eZ/Publish/Core/FieldType/DateAndTime/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0078326

Please sign in to comment.