Question: Am having problem in using simple date format for this: having date as

```
12/13/2011 12:00:00 AM

```

For that am using:

```
SimpleDateFormat form = new SimpleDateFormat("dd/MMMM/yyyy HH:mm:ss");

```

but throwing an exception while coversion saying:

```
java.text.ParseException: Unparseable date: 12/13/2011 12:00:00 AM

```

how to fix this?

Thanks

Answer: 
Convert Date from dd/mm/yyyy to mm-dd-yyyy

```
if (date.matches("\\d{2}/\\d{2}/\\d{4}")) {
    SimpleDateFormat fromUser = new SimpleDateFormat("MM/dd/yyyy");
    SimpleDateFormat myFormat = new SimpleDateFormat("yyyy-MM-dd");
    parsedDate = myFormat.format(fromUser.parse(date));
}

```
```
SimpleDateFormat form = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss aa");

```