From 2d8dec70b1cd6411865da7c4af29f94851d2541a Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Tue, 3 May 2022 10:07:01 +0000 Subject: [PATCH] fix timezone issue --- p3k/Weather.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/p3k/Weather.php b/p3k/Weather.php index e28d918..c77c71c 100644 --- a/p3k/Weather.php +++ b/p3k/Weather.php @@ -63,10 +63,7 @@ class Weather { 'unit' => '%' ]; - $tz = new DateTimeZone($data->timezone); - $now = new DateTime(); - $now->setTimeZone($tz); - $offset = $now->format('Z')/3600; + $offset = $data->timezone; $weather['timezone']['name'] = $sunny['timezone']; $weather['timezone']['offset'] = $offset;