The later date
The earlier date
Optional
An object with options
The number of full years
differenceInYears
Get the number of full years between the given dates.
// How many full years are between 31 December 2013 and 11 February 2015?const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))//=> 1 Copy
// How many full years are between 31 December 2013 and 11 February 2015?const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))//=> 1
The later date