How does JavaScript realize that the date minus days equals the second date
This article is about how JavaScript realizes that the date minus the number of days equals the second date. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Date minus days equals second date
Function cc (dd,dadd) {/ / can add error handling var a = new Date (dd) a = a.valueOf () a = a-dadd * 24 * 60 * 60 * 1000a = new Date (a) alert (a.getFullYear () + "year" + (a.getMonth () + 1) + "month" + a.getDate () + "day")} cc ("1223Univer 2002", 2) Thank you for reading! This is the end of the article on "how to achieve the date minus the number of days equal to the second date in JavaScript". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!