From b572edc0715b6d0b6939868cedaa3fd985a27c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Mat=C4=9Bj=C4=8Dek?= Date: Tue, 12 Sep 2023 22:41:28 +0200 Subject: [PATCH] DateTime: build from timestamp use method setTimestamp(), keep default timezone --- src/Utils/DateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/DateTime.php b/src/Utils/DateTime.php index 963407c0d..648a88adb 100644 --- a/src/Utils/DateTime.php +++ b/src/Utils/DateTime.php @@ -52,7 +52,7 @@ public static function from(string|int|\DateTimeInterface|null $time): static $time += time(); } - return (new static('@' . $time))->setTimezone(new \DateTimeZone(date_default_timezone_get())); + return (new static())->setTimestamp($time); } else { // textual or null return new static((string) $time);