165
164
"""dayofweek == 0 means Sunday, whichweek 5 means last instance"""
166
165
first = datetime.datetime(year, month, 1, hour, minute)
167
166
weekdayone = first.replace(day=((dayofweek-first.isoweekday())%7+1))
169
168
dt = weekdayone+(whichweek-n)*ONEWEEK