In this section, we are going to determine the difference between two dates.
getFullYear()-This method return the current year.
Following code calculate the difference between two dates in days:
Here is the code:
Output will be displayed as: