Any judge of the supreme court, court of appeals, or superior court of the state of Washington who heretofore and/or hereafter shall have served as a judge of any such courts for eighteen years in the aggregate or who shall have served ten years in the aggregate and shall have attained the age of seventy years or more may, during or at the expiration of his or her term of office, in accordance with the provisions of this chapter, be retired and receive the retirement pay herein provided for. In computing such term of service, there shall be counted the time spent by such judge in active service in the armed forces of the United States of America, under leave of absence from his or her judicial duties as provided for under chapter 201, Laws of 1941: PROVIDED, HOWEVER, That in computing such credit for such service in the armed forces of the United States of America no allowance shall be made for service beyond the date of the expiration of the term for which such judge was elected. Any judge desiring to retire under the provisions of this section shall file with the director of retirement systems, a notice in duplicate in writing, verified by his or her affidavit, fixing a date when he or she desires his or her retirement to commence, one copy of which the director shall forthwith file with the administrator for the courts. The notice shall state his or her name, the court or courts of which he or she has served as judge, the period of service thereon and the dates of such service.