Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

getMonth

import { getMonth } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Which month is 29 February 2012?
const result = getMonth(new Date(2012, 1, 29))
//=> 1
function getMonth<DateType extends Date>(date: DateType | number | string): number;
§
getMonth<DateType extends Date>(date: DateType | number | string): number
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The given date

§Return Type

§
number
[src]

The month index (0-11)