How long did the revolutionary war last?

1. The signing of the Declaration of Independence in 1776.

2. The Battle of Yorktown in 1781.
3. The signing of the Treaty of Paris in 1783.