Skip to content

Commit

Permalink
DateTime: build from timestamp use method setTimestamp(), keep defaul…
Browse files Browse the repository at this point in the history
…t timezone
  • Loading branch information
h4kuna committed Sep 12, 2023
1 parent 71017d2 commit b572edc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b572edc

Please sign in to comment.