calendar.weekday()
calendar.weekday() is a Python function in the Calendar Module category. Returns the day of the week (0=Monday, 6=Sunday). The syntax is calendar.weekday(year, month, day). Returns: Integer 0-6. A typical example: calendar.weekday(2026, 6, 6) # 5 (Saturday). A close sibling is calendar.TextCalendar(), which creates a calendar that generates plain text calendars. A close sibling is calendar.HTMLCalendar(), which creates a calendar that generates HTML calendars. A close sibling is calendar.isleap(), which returns True if the year is a leap year. A close sibling is calendar.leapdays(), which returns the number of leap years in the range [y1, y2). More about this category: Calendar functions — TextCalendar, isleap, monthrange, weekday. For a broader walkthrough, read the Calendar Module guide. Related Calendar Module entries: calendar.TextCalendar(), calendar.HTMLCalendar(), calendar.isleap(), calendar.leapdays(), calendar.monthrange(), calendar.day_name. This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.