Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.getDay()

Retrieve the numeric day of the week index from zero for Sunday through six for Saturday.

The getDay method returns an integer representing the day of the week for the current NepaliDate instance. The return value ranges from 0 for Sunday to 6 for Saturday, aligning with standard JavaScript date conventions.


Import

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

Signature

getDay(): number;

Parameters

  • None.

Return Value

  • Type: number
  • Range: 0 to 6
IndexWeekday (English)Weekday (Devanagari)
0Sundayआइतबार
1Mondayसोमबार
2Tuesdayमङ्गलबार
3Wednesdayबुधबार
4Thursdayबिहिबार
5Fridayशुक्रबार
6Saturdayशनिबार

Example

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

// 2081 Kartik 15 fell on a Friday
const date = new NepaliDate("2081-07-15");
console.log(date.getDay()); // 5

Advertisement

On this page