I have a dataset with different entries for hours. Example 23:59 and 11:59PM. I have tried using the command below but did not work. It is changing only the time that appears PM and AM and making NA in other rows
t <- "1:36:22 PM" as.POSIXlt(t, format = "%H:%M:%S")