tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
728 stars 207 forks source link

ymd_hm() failing to parse strings #1093

Closed BrentWHR closed 1 year ago

BrentWHR commented 1 year ago

In version 1.9.0, ymd_hm() fails to parse characters such as "2022-11-03 15:05". The output I expect is "2022-11-03 15:05:00 UTC" of class "POSIXct" "POSIXt" This was the case in versions prior to 1.9.0

In 1.9.0 parsing such data with ymd_hm() raises a warning and returns NA

remotes::install_version('lubridate', version = '1.8.0')

packageVersion('lubridate')
# [1] ‘1.8.0’

x <- "2022-11-03 15:05"

lubridate::ymd_hm(x)
# "2022-11-03 15:05:00 UTC"

# now with 1.9.0
install.packages('lubridate')

packageVersion('lubridate')
# [1] ‘1.9.0’

lubridate::ymd_hm(x)
# [1] NA
# Warning message:
# All formats failed to parse. No formats found.
BrentWHR commented 1 year ago

Appologies, I took to long writing this issue, its seems to be a duplicate of #1092

vspinu commented 1 year ago

Fixed in devel. Sorry for the trouble.