The later date
The earlier date
Optional
An object with options
The number of full months
differenceInMonths
// How many full months are between 31 January 2014 and 1 September 2014?const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))//=> 7 Copy
// How many full months are between 31 January 2014 and 1 September 2014?const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))//=> 7
The later date