Methods
date.get_day()
Retrieve the numeric day of the week index from zero for Sunday through six for Saturday.
The get_day 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 calendar day conventions.
Import
from nepali_date_library import NepaliDateSignature
def get_day(self) -> int:Parameters
- None.
Return Value
- Type:
int - Range:
0to6 - Description: Day of the week integer starting from
0for Sunday up to6for Saturday.
Example
from nepali_date_library import NepaliDate, week_en
date = NepaliDate("2081-07-15")
weekday_index = date.get_day()
print(weekday_index) # 5 (Friday)
print(week_en[weekday_index]) # "Friday"Related
NepaliDate.get_day_name(): Retrieve localized weekday names.date.get_date(): Retrieve the day of the month.
Advertisement
date.get_date()
Retrieve the numeric day of the month from a NepaliDate instance.
date.get_hours()
Retrieve the hour component from zero to twenty three for the current date instance.