The chain most quote sites are standing on is short and points the wrong way. Baseball Almanac ↗ carries the trimmed one-liner and gives as its source Rod Cross’s Physics of Baseball & Softball (Springer, 2011), p. 85 — a modern textbook. Simple English Wikiquote ↗ then cites Baseball Almanac. Nothing in that chain is closer to Williams than a secondary work published nine years after his death.
Running the phrase through the full text of Internet Archive’s scanned books tells a different and more useful story, and it is a story about dates. Every printing from the 1980s carries the longer form: Boswell’s essay collection in 1982, Bob Chieger’s Voices of Baseball in 1984, then compilations by David Plaut and Wayne Stewart. The trimmed one-liner turns up in books too, but only from the 2000s — Ron White’s 22 Success Lessons from Baseball (2004), John Marlowe’s It Ain’t Over ’Til It’s Over (2010), Neil Shalin’s Red Sox Triviology (2011) and Bruce Spitzer’s novel Extra Innings (2012). Chieger tags the remark “Ted Williams, former outfielder, 1976,” which is the closest thing to a date anyone offers.
Worth noting without over-reading it: the punchline was already a joke-book gag well before Williams is supposed to have said it. Francis Leo Golden’s Jest What the Doctor Ordered (Pocket Books, 1952) contains “… know what to do . . . you’re too old to do it” in a setting that has nothing to do with baseball. That does not show Williams borrowed it — it shows he was working a shape of joke that was already in the air.