Source code var millisecondsPerDay = 1000 * 60 * 60 * 24; var d1 = new Date(); // get current date var d2 = new Date(d1.getTime() + millisecondsPerDay * 30); document.writeln('Current date: ' + d1 + ''); document.writeln('30 days into the future: ' + d2 + '');