r - How to deal with change in default of lubridate's ymd -
in ymd
lubridate, default value of tz
utc
. don't know when change made know in 1.5 default utc in 1.5.8 default null
.
this changes output of ymd
posixct
objects date
objects breaks lot of code rely on having posixct
object have date
. there convenient way make backwards compatible or need add tz='utc'
of old code relied on this?
write wrapper replace ymd
ymd_hms
default still tz = "utc"
library(lubridate) ymd2 = function(x){ ymd_hms(paste(x, "00:00:00")) } ymd2("2017/3/4") #[1] "2017-03-04 utc" class(ymd2("2017/3/4")) #[1] "posixct" "posixt"
wiki
Comments
Post a Comment