Skip to content

Wrong timezones for both flights and weather? #28

@ismayc

Description

@ismayc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions