I want to get reaming days to go particular date so i am trying to detection of particular date with today date. but this not working here is my code If the date is next m
I think you can subtract it:
var date2 = new Date(2012, 3, 19); // 1st argument = year, 2nd = month - 1 (because getMonth() return 0-11 not 1-12), 3rd = date
var date1 = new Date(2012, 4, 27);
var distance = date1.getTime() - date2.getTime();
distance = Math.ceil(distance / 1000 / 60 / 60 / 24); // convert milliseconds to days. ceil to round up.
document.write(distance);