I'm trying to get the current date and tomorrow's date and yesteday's date as well in this format 2015-05-21
I've made these functions which work pretty good, but I wanna get your perspective about that, i'm not really expert in javascript, so I want to make sure that will work properly on my application.
function gettodaydate() {
var d = new Date();
var date=""+d.getFullYear()+"-"+d.getMonth()+"-"+d.getDate();
return date;
}
function gettomorrowdate() {
var d = new Date();
var date=""+d.getFullYear()+"-"+d.getMonth()+"-"+(d.getDate()+1);
return date;
}
function getyesterdaydate() {
var d = new Date();
var date=""+d.getFullYear()+"-"+d.getMonth()+"-"+(d.getDate()-1);
return date;
}