Q: In this task, you are given a question and a context passage. You have to answer the question based on the given passage.
When did Whitney develop his cotton gin, Context: The city struck fortune in the late 18th century with the inventions and industrial activity of Eli Whitney, a Yale graduate who remained in New Haven to develop the cotton gin and establish a gun-manufacturing factory in the northern part of the city near the Hamden town line. That area is still known as Whitneyville, and the main road through both towns is known as Whitney Avenue. The factory is now the Eli Whitney Museum, which has a particular emphasis on activities for children and exhibits pertaining to the A. C. Gilbert Company. His factory, along with that of Simeon North, and the lively clock-making and brass hardware sectors, contributed to making early Connecticut a powerful manufacturing economy; so many arms manufacturers sprang up that the state became known as "The Arsenal of America". It was in Whitney's gun-manufacturing plant that Samuel Colt invented the automatic revolver in 1836. The Farmington Canal, created in the early 19th century, was a short-lived transporter of goods into the interior regions of Connecticut and Massachusetts, and ran from New Haven to Northampton, Massachusetts.
A:
in the late 18th century