Nepali DateNepali DateBikram Sambat Date Engine
Static Methods

NepaliDate.get_month_name()

Static utility to retrieve the localized English or Nepali month name for any month index.

The get_month_name static method returns the localized name of a Bikram Sambat month given its zero based index from 0 for Baisakh to 11 for Chaitra. It supports full names as well as short abbreviations in both English and Devanagari script.


Import

from nepali_date_library import NepaliDate

Signature

@staticmethod
def get_month_name(
    month: int,
    short: bool = False,
    nepali: bool = False
) -> str:

Parameters

ParameterTypeRequiredDefaultDescription
monthintYes-Zero based month index from 0 to 11.
shortboolNoFalseReturn abbreviated three letter or short string.
nepaliboolNoFalseReturn name in native Devanagari Nepali script.

Return Value

  • Type: str
  • Description: Localized month name string.

Examples

from nepali_date_library import NepaliDate

# English full name (Kartik is index 6)
print(NepaliDate.get_month_name(6)) # "Kartik"

# English abbreviation
print(NepaliDate.get_month_name(6, short=True)) # "Kar"

# Devanagari full name
print(NepaliDate.get_month_name(6, nepali=True)) # "कार्तिक"

# Devanagari abbreviation
print(NepaliDate.get_month_name(6, short=True, nepali=True)) # "का"

Advertisement

On this page