I recently updated to R version 4.4 and lubridate version 1.9.1 and started getting this error below when I try to add a period of time to a posixct variable.
Error in C_time_add(time, periods, roll_month, roll_dst) : CCTZ: Invalid timezone of the input vector: “”
A google search showed that this was a problem in an earlier version of lubridate, but was fixed. Does anyone have any insight into how it can be resolved? For small time intervals I can calculate and add the number of seconds elapsed, but that’s a problem if I want to add months or years to the date. Any comments are appreciated! Thanks
as.POSIXct(“2024-5-23”)+ days(1)
Error in C_time_add(time, periods, roll_month, roll_dst) :
CCTZ: Invalid timezone of the input vector: “”
It works as expected if I use as.Date
as.Date(“2024-5-23”)+ days(1)
[1] “2024-05-24”
user25209989 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.