require "date" t = gets.chomp t2 = DateTime.strptime(t, "%H:%M") t3 = t2.min + 5 p "#{t2.hour}:#{t3}"