It is the universal custom to display the flag only from sunrise to sunset on buildings and on flagstaffs in the open. However, when a patriotic effect is desired, the flag may be displayed twenty-four hours if properly illuminated during the hours of darkness.
The flag when flown at half-staff, should be first hoisted to the peak foe an instant and then lowered to the half-staff position. The flag should be again raised to the peak before it is lowered for the day. On Memorial Day, the flag should be displayed at half-staff until noon only, then raised to the top of the staff. By order of the President, the flag shall be flown at half-staff upon the death of principal figures of the United States Government and the Governor of the State, territory or possession, as a mark of respect to their memory. In the event of the death of other officials or foreign dignitaries, the flag is to displayed at half-staff according to Presidential instructions or orders, or in accordance with recognized customs or practices not inconsistent with law.
In the event of the death of a president or former official of the government of any other State, territory or possession of the United States, the Governor of that State, territory or possession may proclaim that the National flag shall be flown at half-staff.
Excerpts From The Flag Code of The United States-Public Law 94-344 July 7, 1976