Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/date_fns/getYear/index.ts>default

date-fns Deno package
Go to Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.0/getYear/index.ts";

Examples

// Which year is 2 July 2014? const result = getYear(new Date(2014, 6, 2)) //=> 2014

Parameters

dirtyDate: Date | number
  • the given date

Returns

number

the year