'Work out the rollover time based on the specified time.'

def computeRollover(self, currentTime):

    result = (currentTime + self.interval)
    if ((self.when == 'MIDNIGHT') or self.when.startswith('W')):
        if self.utc:
            t = time.gmtime(currentTime)
        else:
            t = time.localtime(currentTime)
        currentHour = t[3]
        currentMinute = t[4]
        currentSecond = t[5]
        r = (_MIDNIGHT - ((((currentHour * 60) + currentMinute) * 60) + currentSecond))
        result = (currentTime + r)
        if self.when.startswith('W'):
            day = t[6]
            if (day != self.dayOfWeek):
                if (day < self.dayOfWeek):
                    daysToWait = (self.dayOfWeek - day)
                else:
                    daysToWait = (((6 - day) + self.dayOfWeek) + 1)
                newRolloverAt = (result + (daysToWait * ((60 * 60) * 24)))
                if (not self.utc):
                    dstNow = t[(-1)]
                    dstAtRollover = time.localtime(newRolloverAt)[(-1)]
                    if (dstNow != dstAtRollover):
                        if (not dstNow):
                            addend = (-3600)
                        else:
                            addend = 3600
                        newRolloverAt += addend
                result = newRolloverAt
    return result
