date format error message in R

I combined datasets and I run the following function but it returned an error message indicated below. I also run a str function and I observed that the date format is displayed as mdy as is on the original datasets and the result for a numeric value is NA

Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
4/1/2019 0:02" "4/1/2019 0:03" "4/1/2019
num NA ..

The difftime() function only takes POSIXct or date class objects as arguments and you are passing string class values. You need to convert them first, take a look at this example:

difftime(as.POSIXct("4/1/2019 0:03", format = "%m/%d/%Y %H:%M", tz = "UTC"),
         as.POSIXct("4/1/2019 0:02", format = "%m/%d/%Y %H:%M", tz = "UTC"))
#> Time difference of 1 mins

Created on 2022-09-18 with reprex v2.0.2

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.