Major Edrington tells Hornblower in Plymouth that the detachment he commands is from the 95th of Foot. Given Hornblower has now passed his Lieutenant board, this sets the episode around 1800-03, according to the books, by which time the 95th had been reformed as a rifle company, wearing green uniforms and using the Baker rifle, whereas Edrington's men are in the standard infantry's more usual red, with the British Pattern musket. This timing, though, validates the Ancient Mariner quotation by Pellew.
However, if this was the Quiberon invasion of 1795, as posited elsewhere, the 95th of the time were en route to the Cape of Good Hope. But the Ancient Mariner is ruled out.