10 USC 6322 - Officers: 30 years

(a) An officer of the Regular Navy or the Regular Marine Corps holding a permanent appointment in the grade of warrant officer, W1, or above who applies for retirement after completing 30 or more years of active service may, in the discretion of the Secretary of the Navy, be retired.
(b) For the purpose of this section, an officers years of active service are computed by adding all his active service in the armed forces.