Skip to content

Commit

Permalink
use force_tz to apply timezone to data on POSIXct_time inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Melloy committed Jun 30, 2021
1 parent 2599919 commit 32df19d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/format_weather.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,8 @@ format_weather <- function(x,
# POSIXct class
if (lubridate::tz(x[, times]) == "" ||
lubridate::tz(x[, times]) == "UTC") {
x[, times := lubridate::ymd_hms(x[, times],
tz = ..time_zone,
quiet = TRUE)]
x[, times := lubridate::force_tz(x[, times],
tzone = ..time_zone)]
}
} else {
# if POSIX formatted times were not supplied, create a POSIXct
Expand Down

0 comments on commit 32df19d

Please sign in to comment.