The Enterprise spent 18 months getting overhauled and refitted,
emerging practically a new ship. Kirk speaks of all Earth's defense
systems being dead when V'Ger comes.
STIII: After being battered to pieces in STII, the Enterprise could be ready again in two weeks. However, after twenty years of service, it's time to retire the ship.
STVI: The Klingon border has many space stations and starbases near it. The Federation is considering mothballing Starfleet if the Klingon Empire disbands.
STVIII: A fleet of at least 22 Starfleet vessels assembled in an emergency defense of Earth from an attacking Borg cube.