I want to do same thing as How do I get the number of days between two dates in JavaScript?
but I want do the same on this date format: 2000-12-31.
2000-12-31
Try this.
var toDate = "2000-12-31"; var fromDate = "2000-10-30"; var diff = Math.floor(( Date.parse(toDate) - Date.parse(fromDate) ) / 86400000);
You wont be asking this question if you have checked the answer with more up-votes and not the marked answer on the link you have provided. :)