'Takes a SYSTEMTIME object, such as retrieved from a TIME_ZONE_INFORMATION
structure or call to GetTimeZoneInformation and interprets it based on the given
year to identify the actual day.
This method is necessary because the SYSTEMTIME structure refers to a day by its
day of the week and week of the month (e.g. 4th saturday in March).
>>> SATURDAY = 6
>>> MARCH = 3
>>> st = SYSTEMTIME(2000, MARCH, SATURDAY, 4, 0, 0, 0, 0)
# according to my calendar, the 4th Saturday in March in 2009 was the 28th
>>> expected_date = datetime.datetime(2009, 3, 28)
>>> TimeZoneDefinition._locate_day(2009, st) == expected_date
True'

@staticmethod
def _locate_day(year, cutoff):

    target_weekday = ((cutoff.day_of_week + 6) % 7)
    week_of_month = cutoff.day
    day = (((week_of_month - 1) * 7) + 1)
    result = datetime.datetime(year, cutoff.month, day, cutoff.hour, cutoff.minute, cutoff.second, cutoff.millisecond)
    days_to_go = ((target_weekday - result.weekday()) % 7)
    result += datetime.timedelta(days_to_go)
    while (result.month == (cutoff.month + 1)):
        result -= datetime.timedelta(weeks=1)
    return result
