javascript convert date from mm/dd/yyyy to yyyymmdd

JavaScript
var yourdate = date.split("/").reverse().join("-");
Source

Also in JavaScript: