getMonth

Commons
stable

Returns the zero-based month index (0 = January, 11 = December) of a Date object. Thin semantic wrapper around Date.prototype.getMonth().

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
The Date instance from which to extract the month index.

API

Return value

The value returned by this util.

An integer between 0 (January) and 11 (December).

Usage

Examples

Ready-to-paste usage snippets.

Extract month index from a date

typescript