Jimmy says he served 3 years. The entire US involvement in WWI was 19 months, but it is obvious that the character is speaking of the whole time he was in the Army, not just during the war. In other episodes it is stated that he joined early in 1916 and fought "two years against the Kaiser" (1917-1918) before being WoA and discharged.