Methods
date.get_year()
Retrieve the four digit Bikram Sambat year number from a NepaliDate instance.
The get_year method returns the full four digit Bikram Sambat year as an integer for the current NepaliDate instance. It returns the complete calendar year such as 2081 within the supported range of 1976 through 2100 BS.
Import
from nepali_date_library import NepaliDateSignature
def get_year(self) -> int:Parameters
- None.
Return Value
- Type:
int - Range:
1976to2100 - Description: Four digit Bikram Sambat year integer.
Example
from nepali_date_library import NepaliDate
date = NepaliDate("2081-07-15")
print(date.get_year()) # 2081Related
date.set_year(): Mutate the year component.date.get_month(): Retrieve the month component.
Advertisement
Instance Properties
Reference for public instance properties available on every NepaliDate object including year, month, day, and underlying timestamp.
date.get_month()
Retrieve the zero based Bikram Sambat month index from zero for Baisakh to eleven for Chaitra.