From 8343e612920f5c83eab8bc44b43caae744c870bf Mon Sep 17 00:00:00 2001 From: KyleKatarn Date: Sat, 23 Jul 2022 17:56:55 +0200 Subject: [PATCH] Copy non immutable dates to apply timezone Fix #194 --- src/OpeningHours.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OpeningHours.php b/src/OpeningHours.php index 39cf104..f929a8c 100644 --- a/src/OpeningHours.php +++ b/src/OpeningHours.php @@ -694,6 +694,10 @@ protected function normalizeDayName(string $day) protected function applyTimezone(DateTimeInterface $date) { if ($this->timezone) { + if ($date instanceof DateTime) { + $date = clone $date; + } + $date = $date->setTimezone($this->timezone); }