The U.S. was in World War 1 for 1 year, 7 months, and 5 days. Although, for the vast majority of 1917, America was figuring out their Draft and manufacturing runs. American troops didn't start arriving in large numbers on the Western front until February-March of 1918.
Hope this helps!
Feel free to mark me the brainliest!