See help(strptime)
for the fine detail on the format strings:
R> d1 <- as.Date("Wed Aug 31 14:14:13 2016", "%a %b %d %H:%M:%S %Y")
R> d1
[1] "2016-08-31"
R> d2 <- as.Date("09/12/2016 10:20 PM EDT", "%m/%d/%Y %H:%M")
R> d2
[1] "2016-09-12"
R>
Once they are parsed as Date
objects, you can format any way you like. Ditto for Datetime
objects.
Edit: And as most date formats are in fact 'known' you can also iterate over a given set and 'guess'. I have some code in RcppBDT (on GitHub but not yet on CRAN) which deals with this:
R> library(RcppBDT)
R>
R> as.Date(toPOSIXct(c("Wed Aug 31 14:14:13 2016", "09/12/2016 10:20 PM EDT")))
[1] "2016-08-31" "2016-09-12"
R>