I want to calculate the duration between 2 date of a data frame which formatted as per below:
Start_date_time
22-JAN-16 04.56.14.325000000 PM
End_date_time
23-JAN-16 05.56.14.325000000 AM
I run the below command:
jm16$diff <- difftime(strptime(jm16$Start_date_time, format = "%d-%b-%Y %H.%M.%S"),
strptime(jm16$End_date_time, format = "%d-%b-%Y %H.%M%S"),
units="mins")
however, it ends up the entire field of jm16$diff is "NA". Anybody please help to advise where I make mistake?
Thanks
Han