Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hourly time is offset by 30 minutes in certain locations #32

Closed
guillaume opened this issue Mar 14, 2023 · 8 comments
Closed

Hourly time is offset by 30 minutes in certain locations #32

guillaume opened this issue Mar 14, 2023 · 8 comments
Labels
bug Something isn't working keep

Comments

@guillaume
Copy link

# mumbai Asia/Kolkata timezone does not return hourly time for requested time 
# offset is 5.5
% curl -s "https://api.pirateweather.net/forecast/<REDACTED>/19.0785451,72.878176,1678732200?&units=si&extend=hourly&tz=precise" | jq '.hourly.data[0].time'
1678730400

# Usually that will return the time requested
# offset is -4 for "America/Toronto"
% curl -s "https://api.pirateweather.net/forecast/<REDACTED>/40.7127281,-74.0060152,1678680000?&units=si&extend=hourly&tz=precise" | jq '.hourly.data[0].time'
1678680000
@github-actions
Copy link

There has been no activity on this issue for ninety days and unless you comment on the issue it will automatically close in seven days.

@github-actions github-actions bot added the stale label Jul 11, 2023
@cloneofghosts
Copy link
Collaborator

cloneofghosts commented Jul 13, 2023

Looks like this issue was missed but I tested and I can confirm that for fractional timezones the time parameter is not aligned with the top of the hour but the daily block works fine.

A city to test this with is St. John's, Newfoundland (47.486771,-52.751787) but you have to use tz=precise to demonstrate the issue otherwise the timezone is completely incorrect.

  "latitude": 47.486771,
  "longitude": -52.751787,
  "timezone": "Etc/GMT+4",
  "offset": -4.0,

VS

  "latitude": 47.486771,
  "longitude": -52.751787,
  "timezone": "America/St_Johns",
  "offset": -2.5,

I'll tag @alexander0042 so he can look into this. #74 seems to be a related issue to this one but was only fixed for time machine data.

@github-actions github-actions bot removed the stale label Jul 14, 2023
@github-actions
Copy link

There has not been any activity on this issue in the last ninety and will automatically close in seven days. Comment on this issue to prevent this issue from closing automatically.

@github-actions github-actions bot added the stale label Oct 12, 2023
@cloneofghosts
Copy link
Collaborator

Will bump this one last time. @alexander0042 maybe this can be sorted for the 2.0 release?

@alexander0042 alexander0042 added bug Something isn't working keep and removed stale labels Oct 12, 2023
@alexander0042
Copy link
Collaborator

Yup! Thanks for the bump. I've tagged it to keep it alive,

Just to clarify here- is the issue that these locations always return the incorrect hourly times, or only when specific times are requested?

@cloneofghosts
Copy link
Collaborator

cloneofghosts commented Oct 12, 2023

I believe this was already fixed in the TimeMachine but when I request data for St. John's, Newfroundland all the times in the hourly block are off by 30m. The daily block returns the correct time so it's just something with the hourly section which isn't working correctly.

I did a test query and the first block in the hourly section shows "time": 1697144400, and converting that into a proper timestamp you get:

1697144400 converts to Thursday October 12, 2023 18:30:00 (pm) in time zone America/St Johns (NDT)

Here's the URL I used to call the API https://api.pirateweather.net/forecast/API/47.486771,-52.751787?units=ca&tz=precise. I'm sure other places with 15/45 minute time zones are off by the same amount.

@alexander0042
Copy link
Collaborator

The classic Gander issue! Fixed this in 2.0i along with my other timezone bugs

@cloneofghosts
Copy link
Collaborator

Did a quick test and can confirm that this is fixed so will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keep
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants