Nepali DateNepali DateBikram Sambat Date Engine
Static Methods

NepaliDate.get_day_name()

Static utility to retrieve the localized English or Nepali name for any day of the week index.

The get_day_name static method converts a numeric weekday index from 0 for Sunday through 6 for Saturday into its localized name. It supports both English and Nepali Devanagari script output, allowing flexible localization across international and local application interfaces.


Import

from nepali_date_library import NepaliDate

Signature

@staticmethod
def get_day_name(
    day: int,
    short: bool = False,
    nepali: bool = False
) -> str:

Parameters

ParameterTypeRequiredDefaultDescription
dayintYes-Weekday index from 0 for Sunday to 6 for Saturday.
shortboolNoFalseReturn abbreviated name.
nepaliboolNoFalseReturn name in Devanagari Nepali script.

Return Value

  • Type: str
  • Description: Localized weekday name string.

Examples

from nepali_date_library import NepaliDate

# English full name (5 is Friday)
print(NepaliDate.get_day_name(5)) # "Friday"

# English abbreviation
print(NepaliDate.get_day_name(5, short=True)) # "Fri"

# Devanagari full name
print(NepaliDate.get_day_name(5, nepali=True)) # "शुक्रबार"

# Devanagari abbreviation
print(NepaliDate.get_day_name(5, short=True, nepali=True)) # "शु"

Advertisement

On this page