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

Function _days_before_month

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

year, month -> number of days in year preceding first day of month.

(year, month)

Source from the content-addressed store, hash-verified

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."
60 assert 1 <= month <= 12, 'month must be in 1..12'
61 return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))
62
63def _ymd2ord(year, month, day):
64 "year, month, day -> ordinal, considering 01-Jan-0001 as day 1."

Callers 2

_ymd2ordFunction · 0.85
_build_struct_timeFunction · 0.85

Calls 1

_is_leapFunction · 0.85

Tested by

no test coverage detected