The United States Constitution was written during the Constitutional Convention in Philadelphia in 1787 and formally signed on September 17, 1787. It became the official framework of government when the required ninth state (New Hampshire) ratified it on June 21, 1788.