Methods
date.end_of_month()
Return a new NepaliDate instance set to the final day of the current Bikram Sambat month.
The end_of_month method returns a new NepaliDate instance positioned on the last valid calendar day of the active month. It automatically checks the calendar map to determine whether the month ends on day 29, 30, 31, or 32, which is useful for monthly reporting and billing cycles.
Import
from nepali_date_library import NepaliDateSignature
def end_of_month(self) -> NepaliDate:Parameters
- None.
Return Value
- Type:
NepaliDate - Description: New date instance on the final day of the current month.
Example
from nepali_date_library import NepaliDate
date = NepaliDate("2081-01-10")
last_day = date.end_of_month()
print(last_day.format("YYYY-MM-DD")) # Day 31 for Baisakh 2081Related
date.start_of_month(): First day of the month.date.days_in_month(): Total days in the month.
Advertisement
date.start_of_month()
Return a new NepaliDate instance set to the first day of the current Bikram Sambat month.
date.start_of_year()
Return a new NepaliDate instance set to the first day of the Bikram Sambat year on 1 Baisakh.