Language Basics JavaScript DHTML



Date Calculation

function nextWeek() {
    var todayInMS = today.getTime()
    var nextWeekInMS = todayInMS + (60 * 60 * 24 * 7 * 1000)
    return new Date(nextWeekInMS)
}



Today is: 

var today = new Date();
document.write(today);



Next week will be:

document.write(nextWeek());