Hello I need to cast dateTimes character like "20/2/06 11:16:16,683"
and having difficulties to do it.
I have tried the classic (NO COMMA FOR MILLI):
R) strptime("20/2/06 11:16:16.683", "%d/%m/%y %H:%M:%OS")
[1] "2006-02-20 11:16:16.682"
This fails for the format I have:
R) strptime("20/2/06 11:16:16,683", "%d/%m/%y %H:%M:%OS")
[1] "2006-02-20 11:16:16"
This too:
R) strptime("20/2/06 11:16:16,683", "%d/%m/%y %H:%M,%OS")
[1] NA
Is there a way to do this directly or should I use a gsub
like function to replace the ,
with a .
before using strptime.