It's a FAQ. You need %Y for four digits years. Or use anytime::anytime() which requires no format string.
- Dirk Eddelbuettel
1 Answers
0
votes
We can use ymd_hms
library(lubridate)
ymd_hms(str1)
data
str1 <- "2000-01-01 00:00:00 +0000 UTC"
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
%Yfor four digits years. Or useanytime::anytime()which requires no format string. - Dirk Eddelbuettel