Passing variable dates into a set of variable declorations

Passing variable dates into a set of variable declorations

I'm not sure if this is the right section to post this, but I am pretty new to jQuery, but have a background in C & assembly, so maybe my thought process is a little different.  I am trying to modify existing bit of code so that I can pass a variable to another variable.  Here is what I mean.

I have the following functions that calls data from a database:

var num_per_page = '10'; //results to display
var page_num = '1'; 
var year = '2013';
var month = '1';
var day = '2';
var hour = '14';
var minute = '00';

I would like to be able to replace the hard coded numbers with variables that will change based on the date and time.  So I would need control over the year, month, and day.

For example,  I would like to be able to pull the most recent data from the previous Friday.  Say today is Monday, Jan 7th, 2012, and I would like to display the tabled data from Friday, Jan 4, 2012.  I would like to automatically be able to take the Month, day and year for each Friday (or any other day) and dynamically pass those variables into the functions listed above.

Something like this:

var year = 'current_year';
var month = 'current_month';
var day = 'current_friday';

So the year, month, and date will need to be fed from some other date function that would calculate what the next appropriate date would be and pass it via the variables listed above.  

If anyone can help me out with the best way to do this or if this can be done easily it would be great.

Thanks.