Skip to content

Commit cead663

Browse files
h4kunadg
authored andcommitted
DateTime: build from timestamp use method setTimestamp(), keep default timezone (#300)
1 parent 0d93403 commit cead663

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Utils/DateTime.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static function from(string|int|\DateTimeInterface|null $time): static
5252
$time += time();
5353
}
5454

55-
return (new static('@' . $time))->setTimezone(new \DateTimeZone(date_default_timezone_get()));
55+
return (new static)->setTimestamp((int) $time);
5656

5757
} else { // textual or null
5858
return new static((string) $time);

0 commit comments

Comments
 (0)