Which war continued longer World War I or World War 2?

World War 2 lasted longer, six years compared to the four years of World War 1.