Out of curiosity, what let you to think that Date objects had a format function? You can easily look up a list of functions that are available to the object... w3schools.com/jsref/jsref_obj_date.asp
var now = new Date();
var dd = now.getDate(); //returns date
var mm = now.getMonth()+ 1; //returns month and you need to add1 because it is array
var yy = now.getFullYear(); //returns full year
var st = dd + '-' + mm + "-" + yy; //format as string
dd-mm-yy, then why does your code saymm-dd-yy?