<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getDaysToExpire(self):
 """Returns the days until this certificate expires :returns: Days until the certificate expires :rtype: int """


        delta = 0
        today = DateTime()
        valid_from = self.getValidFrom() or today
        valid_to = self.getValidTo()

        # one of the fields is not set, return 0 days
        if not valid_from or not valid_to:
            return 0
        # valid_from comes after valid_to?
        if valid_from > valid_to:
            return 0
        # calculate the time between today and valid_to, even if valid_from
        # is in the future.
        else:
            delta = valid_to - today

        return int(math.ceil(delta))