# File lib/rufus/scheduler/cronline.rb, line 141
    def next_time(from=ZoTime.now)

      nt = nil
      zt = ZoTime.new(from.to_i + 1, @timezone)
      maxy = from.year + NEXT_TIME_MAX_YEARS

      loop do

        nt = zt.dup

        fail RangeError.new(
          "failed to reach occurrence within " +
          "#{NEXT_TIME_MAX_YEARS} years for '#{original}'"
        ) if nt.year > maxy

        unless date_match?(nt)
          zt.add((24 - nt.hour) * 3600 - nt.min * 60 - nt.sec)
          next
        end
        unless sub_match?(nt, :hour, @hours)
          zt.add((60 - nt.min) * 60 - nt.sec)
          next
        end
        unless sub_match?(nt, :min, @minutes)
          zt.add(60 - nt.sec)
          next
        end
        unless sub_match?(nt, :sec, @seconds)
          zt.add(next_second(nt))
          next
        end

        break
      end

      nt
    end