var d1 = new Date("08/14/2020"); var d2 = new Date("09/14/2020"); var diff = d2.getTime() - d1.getTime(); var daydiff = diff / (1000 * 60 * 60 * 24); document.write(daydiff + " days" );