Mismatch between DayWeather date and HourWeather date

A year ago I filed feedback FB13055082 about this and I just realized that it was marked as "works as currently designed". I need help understanding why this is the expected behavior.

For the feedback example I used Nepal, which is +5:45 from GMT.

When the UTC offset is not at an hour interval, the dates returned by DayWeather and HourWeather do not match.

I’ll request weather with a start date of Aug 25 at 12:0:0 AM GMT+5:45 and end date of Sep 3 at 12:0:0 AM GMT+5:45.

The first daily forecast returns a date of Aug 25, 2023 at 12:0:0 AM GMT+5:45, which is what I expect. It's midnight in Nepal and the start of the day. If in my code I call (correct calendar).startOfDay(for: ) I'll also get this same time back.

However, the first hourly forecast returned is for Aug 25, 2023 at 12:45:0 AM GMT+5:45 which is NOT the start of the day in Nepal or the start I asked for. It is 45 minutes off.

How is the hourly data not starting at the time I requested the expected behavior? Especially when the day data does start at the time I requested.

How is the hourly data not starting at the time I requested the expected behavior? Especially when the day data does start at the time I requested.

The underlying data store is being stored in a way that only expect 1 hour UTC offsets.

The daily forecast here:

The first daily forecast returns a date of Aug 25, 2023 at 12:0:0 AM GMT+5:45, which is what I expect.

...was stored as "the daily forecast", so there isn't anything to correct.

On the other hand:

However, the first hourly forecast returned is for Aug 25, 2023 at 12:45:0 AM GMT+5:45 which is NOT the start of the day in Nepal or the start I asked for. It is 45 minutes off.

The hourly data available was (I believe) stored at with an offset of GMT-5, so that data started at 12:00 GMT + 5 -> 11:45 GMT + 5:45. The API contract says that we won't return data earlier than the requested date, so returns the next full entry and every subsequent entry.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Mismatch between DayWeather date and HourWeather date
 
 
Q