I'm trying to integrate the current weather api - so far so good. I stumbled over a few details, one is the way you provide sunset and sunrise information in rendered to string information. in my case the times are off by the standard UTC offset (in my case +2).

It's nice, that the api response is human readable, but as it's consumed mostly by machines, it would be way better to get such information in numerical datetime format. this way the utc offset correction for display are simple to implement on the client (instead of parsing your data back and forth..).

Did I miss a magic query parameter to overcome this problem?

Yan

Category: API

Replies

Yannick says:
October, Friday, 2017 at 9:19AM

or maybe it's even a bug.

shouldn't the datetime, sunrise and sunset information be in local-time? you provide the correct IANA timezone, but all response properties are providing information with the wrong time offset.

here an example, of what I get right now:

"timezone": "Europe/Zurich" "datetime":"2017-10-13:09" "sunrise":"05:44" "sunset":"16:44"

correct would be:

"timezone": "Europe/Zurich" "datetime":"2017-10-13:11" "sunrise":"07:44" "sunset":"18:44"

hope this helps somehow.

John says:
October, Monday, 2017 at 5:28PM

Currently all times returned by the API are in UTC/GMT. We provide the timezone, and you must convert it to local-time using this timezone. We do plan on adding a parameter to perform this conversion in the near future.

Regarding the sunset/sunrise time, thanks for the information. We will be sure to improve this in the next version release.

  • John

Leave A Reply

What is two minus 1?