On this page
calendar.weekday
Prev: calendar.timegm | Up: calendar | Next: calendar.weekheader
Rel: calendar.calendar, calendar.Calendar, calendar.Day, calendar.firstweekday
Ref: docs.python.org — calendar.weekday
Tags: #public #python3 #stdlib #calendar
Import
import calendar
from calendar import weekday
Signature & Overview
calendar.weekday(year, month, day)
Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).
Usage
import calendar
assert calendar.weekday(2026, 12, 2) == calendar.WEDNESDAY
Gotchas
- 0 = Monday, 6 = Sunday: Matches
datetime.date(y, m, d).weekday().
REPL Inspect
from calendar import weekday
help(weekday)
Linked from
Related notes
- tuts/python3/stdlib_module/calendar/timegm Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/weekheader Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/calendar Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/Calendar_class Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/Day Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/firstweekday Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/calendar/HTMLCalendar shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/IllegalMonthError shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/IllegalWeekdayError shared tags: #calendar, #stdlib