Get tomorrow date and next year date - Node.js Date

Node.js examples for Date:Year

Description

Get tomorrow date and next year date

Demo Code


function tomorrow(){
  var x = new Date();
  x.setDate(x.getDate() + 1);/* ww  w .j  ava  2 s .  co  m*/
  return x;
}

function nextYear(){
  var x = new Date();
  x.setDate(x.getDate() + 365);
  return x;
}

function addDay(d){
  var x = new Date();
  x.setDate(d.getDate() + 1);
  return x;
}

function sleep(delay){
  var start = new Date().getTime();
  while (new Date().getTime() < start + delay);
}

Related Tutorials