Browse Source

fix timezone issue

main
Aaron Parecki 2 years ago
parent
commit
2d8dec70b1
1 changed files with 1 additions and 4 deletions
  1. +1
    -4
      p3k/Weather.php

+ 1
- 4
p3k/Weather.php View File

@ -63,10 +63,7 @@ class Weather {
'unit' => '%' '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']['name'] = $sunny['timezone'];
$weather['timezone']['offset'] = $offset; $weather['timezone']['offset'] = $offset;

Loading…
Cancel
Save