Skip to content

Commit

Permalink
Merge pull request #41 from PcComponentes/bugfix/unexpected-timezone-…
Browse files Browse the repository at this point in the history
…asignation-on-from-factory

Prevent generate not UTC datetime
  • Loading branch information
calmohallag authored Jan 13, 2025
2 parents 15fa381 + 098ce79 commit abeffb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Domain/Model/ValueObject/DateTimeValueObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ final private function __construct($time, $timezone)

final public static function from(string $str): static
{
return new static($str, new \DateTimeZone(self::TIME_ZONE));
$timeZone = new \DateTimeZone(self::TIME_ZONE);

return (new static($str, $timeZone))->setTimezone($timeZone);
}

final public static function now(): static
Expand Down

0 comments on commit abeffb9

Please sign in to comment.