MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / monthrange

Function monthrange

tools/python-3.11.9-amd64/Lib/calendar.py:122–129  ·  view source on GitHub ↗

Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for year, month.

(year, month)

Source from the content-addressed store, hash-verified

120
121
122def monthrange(year, month):
123 """Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
124 year, month."""
125 if not 1 <= month <= 12:
126 raise IllegalMonthError(month)
127 day1 = weekday(year, month, 1)
128 ndays = mdays[month] + (month == February and isleap(year))
129 return day1, ndays
130
131
132def _monthlen(year, month):

Callers 2

itermonthdaysMethod · 0.85
itermonthdays3Method · 0.85

Calls 3

IllegalMonthErrorClass · 0.85
weekdayFunction · 0.85
isleapFunction · 0.85

Tested by

no test coverage detected