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

Function _days_in_month

tools/python-3.11.9-amd64/Lib/datetime.py:51–56  ·  view source on GitHub ↗

year, month -> number of days in that month in that year.

(year, month)

Source from the content-addressed store, hash-verified

49 return y*365 + y//4 - y//100 + y//400
50
51def _days_in_month(year, month):
52 "year, month -> number of days in that month in that year."
53 assert 1 <= month <= 12, month
54 if month == 2 and _is_leap(year):
55 return 29
56 return _DAYS_IN_MONTH[month]
57
58def _days_before_month(year, month):
59 "year, month -> number of days in year preceding first day of month."

Callers 3

_ymd2ordFunction · 0.85
_ord2ymdFunction · 0.85
_check_date_fieldsFunction · 0.85

Calls 1

_is_leapFunction · 0.85

Tested by

no test coverage detected