Hi,
The function that you would be looking to use would be the setFullYear() function of the Date object in javascript. setFullYear() sets the date value, taking three variables (four digit year, month and day). The month is base 0 so Janary would be 0, for example:
-
var date1 = new Date();
-
date1.setFullYear(2007,0,1);
-
would set date1 to the 1st January 2007. The dates are actually stored as integers and their base value is the number of milliseconds since 1st January 1970, so if you subtract one date from another you would get the difference in time in milliseconds. Once you have this it would be simple arithmetics to convert the difference into whatever unit of time that you want.
If you are still having difficulties please post back your attempted code to look at.