Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.add_days()

Add or subtract a specified number of days to a NepaliDate instance with automatic month and year rollover.

The add_days method modifies the current NepaliDate instance by adding or subtracting a given integer number of days. It automatically handles variable Bikram Sambat month day counts, transitions across month boundaries, and advances or decrements the year when needed.


Import

from nepali_date_library import NepaliDate

Signature

def add_days(self, days: int) -> NepaliDate:

Parameters

ParameterTypeRequiredDescription
daysintYesPositive or negative number of days to add.

Return Value

  • Type: NepaliDate
  • Description: Returns self after mutating the internal coordinates.

Example

from nepali_date_library import NepaliDate

date = NepaliDate("2081-01-25")
date.add_days(10)
print(date.format("YYYY-MM-DD")) # Transitions into Jestha

Advertisement

On this page