No timezone specified in hourly forecasts

  • 3
  • Problem
  • Updated 6 years ago
it seems that the timezone value of attribute "tz" is always empty for the features hourly10day and hourly.
This is really annoying if you need to convert time zones. because you don't know the source timezone...

example API calls where tz is empty:

is this normal or is this a bug?
Photo of Bram Desoete

Bram Desoete

  • 5 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 3
Photo of afroditi


  • 5 Posts
  • 0 Reply Likes
I had recently this problem as you and i found a solution. With Php you can convert the date to another timezone.

$dateTo=date_create($dateFrom, new DateTimeZone($TimeZoneNameFrom))->setTimezone(new DateTimeZone($TimeZoneNameTo))->format("Y-m-d H:i");

where $dateFrom is the pretty object value for every hour, $dateFrom is the timezone that you want to convert like EET or "Europe/Athens", $TimeZoneNameTo is the timezone that you want to convert your date like UTC or America/Toronto.
$dateTo is the converted date in the timezone you want with format Year-month-day 14Hour:minutes "Y-m-d H:i" like 2014-11-20 14:53