I'm not sure about the full history of it, but the current statute indicates it was passed in 1956.US code still defines the militia as every able bodied male between 17 and 45, and female members of the National Guard. Which is why grabbers ranting about "herp derp, but youre not in a militia" is hilarious.
*43-year-old
(Aug. 10, 1956, ch. 1041, 70A Stat. 14, § 311; Pub. L. 85–861, § 1(7), Sept. 2, 1958, 72 Stat. 1439; Pub. L. 103–160, div. A, title V, § 524(a), Nov. 30, 1993, 107 Stat. 1656; renumbered § 246, Pub. L. 114–328, div. A, title XII, § 1241(a)(2), Dec. 23, 2016, 130 Stat. 2497.)
I believe the last substantive change was adding females who are members of the National Guard, with most of the changes subsequent being renumberings and formatting changes.