formatdatetime with js code example
Example 1: Javascript format date / time
var date = new Date('2014-8-20');
console.log((date.getMonth()+1) + '/' + date.getDate() + '/' + date.getFullYear());
Example 2: js datetime format
new Date().toISOString().slice(0, 16).replace("T", " ")