Skip to main content
Very Popular
Go to Latest
function differenceInYears
import { differenceInYears } from "https://deno.land/x/date_fns@v2.2.0/index.js";

Examples

// How many full years are between 31 December 2013 and 11 February 2015? var result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) //=> 1

Parameters

dirtyDateLeft
  • the later date
dirtyDateRight
  • the earlier date