anyflights icon indicating copy to clipboard operation
anyflights copied to clipboard

Wrong timezones for both `flights` and `weather`?

Open ismayc opened this issue 8 months ago • 4 comments

The issue is similar to this issue from nycflights13 except now it looks like flights is on UTC and weather is on local time (for the machine in use) . I think the solution is to use lubridate::force_tz() on the time_hour variable pulling corresponding to timezone from airports::tzone for both?

library(nycflights23)

flights$time_hour[1:5]
#> [1] "2023-01-01 20:00:00 UTC" "2023-01-01 23:00:00 UTC"
#> [3] "2023-01-01 23:00:00 UTC" "2023-01-01 21:00:00 UTC"
#> [5] "2023-01-01 20:00:00 UTC"

weather$time_hour[1:5]
#> [1] "2023-01-01 01:00:00 MST" "2023-01-01 02:00:00 MST"
#> [3] "2023-01-01 03:00:00 MST" "2023-01-01 04:00:00 MST"
#> [5] "2023-01-01 05:00:00 MST"

Created on 2025-04-20 with reprex v2.1.1

ismayc avatar Apr 20 '25 20:04 ismayc

Thank you for the issue! Happy to see that you're still getting value from the package. :)

That seems reasonable—would you be game to give a go at a PR? Would be happy to review and get that to CRAN if so—happy to spend some time on a fix in the near future if not.

simonpcouch avatar Apr 24 '25 21:04 simonpcouch

Tons of use :). Too many areas to explore! I’ll try to block off some time to get this implemented and tested sometime soon. Thanks!

ismayc avatar Apr 24 '25 22:04 ismayc

Haven’t been able to squeeze this in. Apologies!

ismayc avatar Jun 04 '25 00:06 ismayc

No worries!

simonpcouch avatar Jun 04 '25 19:06 simonpcouch