Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.set_date()

Set the day of the month on a NepaliDate instance and recalculate its timestamp.

The set_date method updates the day of the month for the current NepaliDate instance and recalculates its underlying Gregorian timestamp. It validates the new day against the maximum number of days available in the active month.


Import

from nepali_date_library import NepaliDate

Signature

def set_date(self, day: int) -> None:

Parameters

ParameterTypeRequiredDescription
dayintYesTarget day of the month between 1 and 32.

Return Value

  • Type: None
  • Note: Mutates the current instance in place.

Example

from nepali_date_library import NepaliDate

date = NepaliDate("2081-07-01")
date.set_date(15)
print(date.format("YYYY-MM-DD")) # "2081-07-15"

Advertisement

On this page