Skip to main content
The Deno 2 Release Candidate is here
Learn more
Very Popular
Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.1/getDecade/index.ts";

Examples

// Which decade belongs 27 November 1942? const result = getDecade(new Date(1942, 10, 27)) //=> 1940

Parameters

dirtyDate: Date | number
  • the given date

Returns

number

the year of decade