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

Function first_sunday_on_or_after

Doc/includes/tzinfo_examples.py:63–67  ·  view source on GitHub ↗
(when)

Source from the content-addressed store, hash-verified

61# A complete implementation of current DST rules for major US time zones.
62
63def first_sunday_on_or_after(when):
64 days_to_go = 6 - when.weekday()
65 if days_to_go:
66 when += dt.timedelta(days_to_go)
67 return when
68
69
70# US DST Rules

Callers 1

us_dst_rangeFunction · 0.70

Calls 1

weekdayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…