MCPcopy Create free account
hub / github.com/python/cpython / first_sunday_on_or_after

Function first_sunday_on_or_after

Lib/test/datetimetester.py:5756–5760  ·  view source on GitHub ↗
(dt)

Source from the content-addressed store, hash-verified

5754# Pain to set up DST-aware tzinfo classes.
5755
5756def first_sunday_on_or_after(dt):
5757 days_to_go = 6 - dt.weekday()
5758 if days_to_go:
5759 dt += timedelta(days_to_go)
5760 return dt
5761
5762ZERO = timedelta(0)
5763MINUTE = timedelta(minutes=1)

Callers 2

dstMethod · 0.70
dstMethod · 0.70

Calls 2

timedeltaClass · 0.90
weekdayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…