Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.days_in_month()

Retrieve the total number of days in the current or specified Bikram Sambat month.

The days_in_month method returns the total number of days present in the active month of the current NepaliDate instance, or for an explicitly provided year and month combination. Because Bikram Sambat month durations vary from 29 to 32 days depending on astronomical solar calculations, this method provides accurate month lengths.


Import

from nepali_date_library import NepaliDate

Signature

def days_in_month(self) -> int:

Parameters

  • None.

Return Value

  • Type: int
  • Range: 29 to 32
  • Description: Total number of days in the active month.

Example

from nepali_date_library import NepaliDate

date = NepaliDate("2081-01-01") # Baisakh 2081
print(f"Days in Baisakh 2081: {date.days_in_month()}") # 31

Advertisement

On this page