Home >Web Front-end >JS Tutorial >javaScript calculates the difference in days between two dates (sample code)_javascript skills
1: Calculate the number of days between two dates
For example:
str1 = "2002-01-20"
str2 = "2002-10-11"
How to use JavaScript to calculate the number of days between str1 and str2?
In JavaScript, calculate the date after today's date. It is far less convenient than in .Net. A function can solve the problem. This problem troubled me for a while, and finally the problem was solved through the introduction of a netizen. Post it and share it.