Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.set()

Set year, month, and day coordinates simultaneously on a NepaliDate instance.

The set method updates the Bikram Sambat year, zero based month index, and day values of the current NepaliDate instance in a single atomic call. It validates the combined coordinates against the calendar map and recalculates the internal timestamp.


Import

from nepali_date_library import NepaliDate

Signature

def set(self, year: int, month: int, date: int) -> None:

Parameters

ParameterTypeRequiredDescription
yearintYesBikram Sambat year integer between 1976 and 2100.
monthintYesZero based month index from 0 (Baisakh) to 11 (Chaitra).
dateintYesDay number of the month from 1 to 32.

Return Value

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

Example

from nepali_date_library import NepaliDate

date = NepaliDate("2080-01-01")
date.set(2081, 6, 15) # Kartik 15, 2081 BS
print(date.format("YYYY-MM-DD")) # "2081-07-15"

Advertisement

On this page