United States Uniformed Services Oath of Office
All officers of the seven Uniformed services of the United States swear or affirm an oath of office upon commissioning. It differs slightly from that of the oath of enlistment that enlisted members recite when they enter the service. It is required by statute, the oath being prescribed by Section 3331, Title 5, United States Code. It is traditional for officers to recite the oath upon promotion but as long as the officer's service is continuous this is not actually required. One notable difference between the officer and enlisted oaths is that the oath taken by officers does not include any provision to obey orders; while enlisted personnel are bound by the Uniform Code of Military Justice to obey lawful orders.
Text of the Oath
I, [name], do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter. So help me God.
Note that the last phrase is not required to be said if the speaker has a personal or moral objection, as is true of all oaths administered by the United States government; Article Six of the United States Constitution requires that there be no religious test for public office.
The oath is for an indeterminate period; no duration is specifically defined.
Officers of the National Guard of the various States, however, take an additional oath:
I, [name], do solemnly swear (or affirm) that I will support and defend the Constitution of the United States and the Constitution of the State (Commonwealth, District, Territory) of ___ against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I will obey the orders of the President of the United States and the Governor of the State (Commonwealth, District, Territory) of ___, that I make this obligation freely, without any mental reservations or purpose of evasion, and that I will well and faithfully discharge the duties of the Office of [grade] in the Army/Air National Guard of the State (Commonwealth, District, Territory) of ___ upon which I am about to enter, so help me God.
Commissioned officers (O-1 [second lieutenant or ensign] through O-10 [general or admiral] and W-2 through W-5 [chief warrant officers]) are commissioned under the authority of the President of the United States with the advice and consent of the United States Senate; warrant officers (WO-1) receive a warrant under the authority of their respective service secretary (e.g., the secretary of the Army or the secretary of the Navy); National Guard officers are additionally committed to the authority of the governor of their state. They may be activated in the service of their state in time of local or state emergency in addition to federal activation. Reserve officers may only be activated by the President of the United States.