Question: I want to convert dd/mm/yyyy to mm/dd/yyyy in javascript.

Answer: 
This is a moment.js version. The library can be found at <http://momentjs.com/>

```
//specify the date string and the format it's initially in
var mydate = moment('15/11/2000', 'DD/MM/YYYY'); 

//format that date into a different format
moment(mydate).format("MM/DD/YYYY");

//outputs 11/15/2000

```
```
var date = "31/03/2017 14:28";
var regex = /(\d+)/g;
var d = date.match(regex);
var out = d[2] + "-" + d[1] + "-" + d[0] + " " + d[3] + ":" + d[4];
var dag = new Date(out);
console.log(dag);

```

This is only solution for numbers with this regex