Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.getYear()

Retrieve the four digit Bikram Sambat year number from a NepaliDate instance.

The getYear method returns the full four digit Bikram Sambat year as an integer for the current NepaliDate instance. Unlike legacy JavaScript Date getYear which returns years minus 1900, this method returns the complete calendar year such as 2081 within the supported range of 1976 through 2100 BS.


Import

import { NepaliDate } from "nepali-date-library";

Signature

getYear(): number;

Parameters

  • None.

Return Value

  • Type: number
  • Range: 1976 to 2100
  • Description: Full 4-digit Bikram Sambat year integer.

Example

import { NepaliDate } from "nepali-date-library";

const date = new NepaliDate("2081-07-15");
console.log(date.getYear()); // 2081

Advertisement

On this page