Question: When was the pledge adopted into the flag code?
Answer: June 22, 1942
Natural Questions answer: 1942 (from the Wikipedia article "Pledge of Allegiance (United States)")