Basically, you have three methods and you have to combine the strings for yourself:
getDate() // Returns the date
getMonth() // Returns the month
getFullYear() // Returns the year
Example:
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth() + 1; //Months are zero based
var curr_year = d.getFullYear();
console.log(curr_date + "-" + curr_month + "-" + curr_year);
Compare two dates with JavaScript
From an array of objects, extract value of a property as array
How do I loop through or enumerate a JavaScript object?
Is there a JavaScript equivalent of PHP’s “variable variables”?
What is the (function() { } )() construct in JavaScript?
How do I copy to the clipboard in JavaScript?
How do I redirect to another webpage?
Sort array of objects by string property value