**A general code which accepts all kind of data format in R.**

I am having problems in getting the date correctly.. My date data set is in dd-mm-yy format, stored in CSV file. When I am trying to run the following program I am getting wrong output.

```
df$date <- as.Date(as.POSIXct(df$date,format='%d %m %Y'))

```

This is my output: 

Instead of showing this in output screen

```
18-10-2000 

```

it's showing :

```
[1] "0018-10-20" 

```

Also, Can you please explain me how can I make my code accept all types of Data formats which are stored in CSV file, such as:

```
DD-MM-YY
MM-DD-YY
Month_Name DD YY
Month_Name YY DD
DD Month_Name YY
YY Month_Name DD

and other formats..

```