Hope this isn't too big a deal to ask, here are some tits for help:
Hey Guys
So here's the code to calculate the various variables for today's date, how can I modify it so it calculates the date 7 days ago (last week)?
Hey Guys
So here's the code to calculate the various variables for today's date, how can I modify it so it calculates the date 7 days ago (last week)?
Code:
// Get today's current date.
var monthNames = new Array("1","2","3","4","5","6","7","8","9","10","11","12");
var now = new Date();
now.setDate(now.getDate());
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array('1','2','3','4','5','6','7','8','9','10','11','12');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today =
now.getDate()
// Print out the data.
returnValue = today;

