Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.getMonth()

Retrieve the zero based Bikram Sambat month index from zero for Baisakh to eleven for Chaitra.

The getMonth method returns the month of the year as an integer between 0 and 11 for the current NepaliDate instance. The library adheres to the JavaScript zero based indexing standard where 0 represents Baisakh, 1 represents Jestha, and 11 represents Chaitra.


Import

import { NepaliDate } from "nepali-date-library";

Signature

getMonth(): number;

Parameters

  • None.

Return Value

  • Type: number
  • Range: 0 to 11
IndexMonth (English)Month (Devanagari)
0Baisakhबैशाख
1Jesthaजेठ
2Ashadh / Asarअसार
3Shrawanश्रावण
4Bhadraभाद्र
5Ashwin / Aswinआश्विन
6Kartikकार्तिक
7Mangsirमंसिर
8Poushपौष
9Maghमाघ
10Falgunफाल्गुण
11Chaitraचैत्र

Example

import { NepaliDate } from "nepali-date-library";

// 2081 Kartik 15
const date = new NepaliDate("2081-07-15");

console.log(date.getMonth()); // 6 (0-indexed)
console.log(date.getMonth() + 1); // 7 (1-indexed for display)

Advertisement

On this page