Jighead
8/1/2017 - 4:13 PM

Format date to mm/dd/yy

Format date to mm/dd/yy

var today = new Date();
var dd = today.getDay()-1; // 0 thru 6, sunday is 0
if (dd < 10) {dd = '0' + dd};
var mm = today.getMonth()+1; // 0 thru 11, Jan is 0
if (mm < 10) {mm = '0' + mm};
var yyyy = today.getFullYear();
var yy = today.getFullYear().toString().slice(2); // slice the 1st 2 chars

console.log(mm+"/" +dd+ "/" + yy);