var inputDate = \'20/4/2010\'.split(\'/\'); var dateFormatted = new Date(parseInt(inputDate[2]), parseInt(inputDate[1]), parseInt(inputDate[0])); var expiryDate
var currentDate = new Date(year,month,day); var expiryDate = new Date(); expiryDate.setTime(currentDate.getTime() + (3 * 365 * 24 * 60 * 60 * 1000));
using the number of seconds past 1970 is fine for this :-) oh, you have more rules. well after that you will still have to check for those cases...