Difference between as.POSIXct/as.POSIXlt and strptime for converting character vectors to POSIXct/POSIXlt
I have followed a number of questions here that asks about how to convert character vectors to datetime classes. I often see 2 methods, the strptime and the as.POSIXct/as.POSIXlt methods. I looked at the 2 functions but am unclear what the difference is. strptime function (x, format, tz = "") { y <- .Internal(strptime(as.character(x), format, tz)) names(y$year) <- names(x) y } <bytecode: 0x045fcea8> <environment: namespace:base> as.POSIXct function (x, tz = "", ...) UseMethod("as.POSIXct") <bytecode: 0x069efeb8> <environment: namespace:base> as.POSIXlt function (x, tz = "", ...) UseMethod("as