Conversation so far:
Where did Matthew Fontaine Maury grow up?
He was born in 1806 in Spotsylvania County, Virginia, near Fredericksburg.
Did Matthew Fontaine Maury's family stay in Spotsylvania County, Virginia?
The family moved to Franklin, Tennessee, when he was five.
How or when did Matthew Fontaine Maury become interested in astronomy or the ocean?
Maury joined the Navy as a midshipman. Almost immediately, Maury began to study the seas and to record methods of navigation.
What made Matthew Fontaine Maury interested in astronomy?
Maury occasionally hosted Adams, who enjoyed astronomy as an avocation, at the Naval Observatory.
What were some methods of navigation that Matthew Fontaine Maury used?
He pored over documents to collect information on winds, calms, and currents for all seas in all seasons.
How did Matthew Fontaine Maury start his career?
He obtained a naval appointment through the influence of Tennessee Representative Sam Houston.
When was Matthew Fontaine Maury appointed to the Navy?
He obtained a naval appointment through the influence of Tennessee Representative Sam Houston, a family friend, in 1825, at the age of 19.

Question: How long was he in the Navy?
Self-contained rewrite: How long was Matthew Fontaine Maury in the Navy?