Lubridate 未在 R 中正确将日期时间转换为 POSIXct (dd/mm/yy hh:mm:ss) [关闭]
2024-01-27
我正在尝试将日期时间从 csv 转换为 POSIXct 以进行数据分析。我已经尝试了多个代码,但要么得到 NA 要么格式错误。
我当前使用的代码是
GRS$datetimelocal<-
GRS$`datetime` %>%
ymd_hms(tz="UTC") %>% # first convert the `Date and Time (UTC)`
column into a 'POSIX' format
with_tz(tzone="Australia/Brisbane") # convert to local
"Australia/Brisbane" date time (UTC + 10hrs)