title: How to get today's, tomorrow's and yesterday's dates on javascript
body: <p>I'm trying to get the current date and tomorrow's date and yesteday's date as well in this format <code>2015-05-21</code></p>
  
  <p>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.</p>
  
  <pre><code>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;        
  }
  </code></pre>