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

Function _isoweek1monday

tools/python-3.11.9-amd64/Lib/datetime.py:2281–2290  ·  view source on GitHub ↗
(year)

Source from the content-addressed store, hash-verified

2279
2280
2281def _isoweek1monday(year):
2282 # Helper to calculate the day number of the Monday starting week 1
2283 # XXX This could be done more efficiently
2284 THURSDAY = 3
2285 firstday = _ymd2ord(year, 1, 1)
2286 firstweekday = (firstday + 6) % 7 # See weekday() above
2287 week1monday = firstday - firstweekday
2288 if firstweekday > THURSDAY:
2289 week1monday += 7
2290 return week1monday
2291
2292
2293class timezone(tzinfo):

Callers 2

_isoweek_to_gregorianFunction · 0.85
isocalendarMethod · 0.85

Calls 1

_ymd2ordFunction · 0.85

Tested by

no test coverage detected