diff --git a/system/I18n/Time.php b/system/I18n/Time.php index 777554291e24..64b4d350e8fd 100644 --- a/system/I18n/Time.php +++ b/system/I18n/Time.php @@ -256,10 +256,10 @@ public static function createFromFormat($format, $datetime, $timezone = null) */ public static function createFromTimestamp(int $timestamp, $timezone = null, ?string $locale = null) { + $time = new self(gmdate('Y-m-d H:i:s', $timestamp), 'UTC', $locale); $timezone ??= 'UTC'; - $date = new DateTime('now', new DateTimeZone($timezone)); - return new self($date->setTimestamp($timestamp)->format('Y-m-d H:i:s'), $timezone, $locale); + return $time->setTimezone($timezone); } /**