How can I convert from a timestamp like this:
aDate <- "9-Apr-17 10:00:00 PM"
convert <- as.Date(aDate, "%d-%b-%y %H:%M:%S")
Right now, convert gives NA
.
How can I convert from a timestamp like this:
aDate <- "9-Apr-17 10:00:00 PM"
convert <- as.Date(aDate, "%d-%b-%y %H:%M:%S")
Right now, convert gives NA
.
This should solve your problem :
format(lubridate::dmy_hms(aDate), format = "%d-%m-%y %H:%M:%S")
"09-04-17 22:00:00"