I have a date character string of "m/d/y hours:min" that I want to convert to just the mdy portion. I have
##to pull just the date portion## voa$dateonly = substr(voa$date,1,10)
##convert to date##
voa$dateonly <- as.Date(voa$dateonly)
But it's returning with two leading zeros at the front and not the complete date as if it's thinking the month is the year (0011-10-20) but in reality the date I need is 11-11-2021. How do I fix this? Date is the full datetime variable and dateonly is the variable I'm trying to create.