differenceInYears
Modified on Tue, 22 Aug 2023
Description
Use this function to get the number of full years between the given dates.
Syntax
differenceInYears(date1, date2)
Returns
Return Value | Description |
---|---|
Number | Return the number of full years between the given dates. |
Sample
Example | Result | Description |
---|---|---|
differenceInYears (1990-3-15, 2023-4-3) | 33 | This function calculates the number of full years between these two dates, March 15, 1990, and April 3, 2023, and returns 33 years. |
To view all the Date functions, click here.
See Also
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article