<P> The 1898--1901 term was for four years . The City Charter was changed to make the mayor's term a two - year one beginning in 1902, but after two such terms was changed back to resume four - year terms in 1906 . George B. McClellan Jr. thus served one two - year term from 1904 to 1905, during which he was elected to a four - year term from 1906 to 1909 . See New York City mayoral elections #Terms and term limits (since 1834). </P> <P> The party of the mayor reflects party registration, as opposed to the party lines run under during the general election . </P> <Table> <Tr> <Th> #</Th> <Th> Portrait </Th> <Th> Name </Th> <Th> Term in office </Th> <Th> Length of service </Th> <Th_colspan="2"> Party affiliation </Th> <Th> Previous office </Th> </Tr> <Tr> <Th> 91 </Th> <Td> </Td> <Td> Robert A. Van Wyck (1849--1918; aged 69) </Td> <Td> January 1, 1898--December 31, 1901 </Td> <Td> 4 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> Chief Justice of the City Court of New York </Td> </Tr> <Tr> <Th> 92 </Th> <Td> </Td> <Td> Seth Low (1850--1916; aged 66) </Td> <Td> January 1, 1902--December 31, 1903 </Td> <Td> 2 years </Td> <Td> </Td> <Td> Republican </Td> <Td> 11th President of Columbia University (1890--1901) </Td> </Tr> <Tr> <Th> 93 </Th> <Td> </Td> <Td> George B. McClellan Jr . (1865--1940; aged 75) </Td> <Td> January 1, 1904--December 31, 1909 </Td> <Td> 6 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> U.S. Representative for New York (1895--1903) </Td> </Tr> <Tr> <Th> 94 </Th> <Td> </Td> <Td> William Jay Gaynor † (1849--1913; aged 64) </Td> <Td> January 1, 1910--September 10, 1913 </Td> <Td> 3 years, 253 days </Td> <Td> </Td> <Td> Democratic </Td> <Td> Judge of the New York Supreme Court (1893--1909) </Td> </Tr> <Tr> <Td> Acting </Td> <Td> </Td> <Td> Ardolph L. Kline </Td> <Td> September 10, 1913--December 31, 1913 </Td> <Td> 113 days </Td> <Td> </Td> <Td> Republican </Td> <Td> President of the Board of Aldermen </Td> </Tr> <Tr> <Th> 95 </Th> <Td> </Td> <Td> John P. Mitchel (1879--1918; aged 38) </Td> <Td> January 1, 1914--December 31, 1917 </Td> <Td> 4 years </Td> <Td> </Td> <Td> Republican </Td> <Td> U.S. Customs Collector of the Port of New York; President of the Board of Aldermen </Td> </Tr> <Tr> <Th> 96 </Th> <Td> </Td> <Td> John F. Hylan (1868--1936; aged 67) </Td> <Td> January 1, 1918--December 30, 1925 </Td> <Td> 8 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> County Judge in Brooklyn </Td> </Tr> <Tr> <Td> Acting </Td> <Td> </Td> <Td> William T. Collins </Td> <Td> December 31, 1925 </Td> <Td> 1 day </Td> <Td> </Td> <Td> Democratic </Td> <Td> President of the Board of Aldermen </Td> </Tr> <Tr> <Th> 97 </Th> <Td> </Td> <Td> Jimmy Walker (1881--1946; aged 65) </Td> <Td> January 1, 1926--September 1, 1932 </Td> <Td> 6 years, 244 days (6 years, 8 months) </Td> <Td> </Td> <Td> Democratic </Td> <Td> New York State Senator (1919--1925) </Td> </Tr> <Tr> <Td> Acting </Td> <Td> </Td> <Td> Joseph V. McKee </Td> <Td> September 1, 1932--December 31, 1932 </Td> <Td> 121 days (4 months) </Td> <Td> </Td> <Td> Democratic </Td> <Td> President of the City Council </Td> </Tr> <Tr> <Th> 98 </Th> <Td> </Td> <Td> John P. O'Brien (1873--1951; aged 78) </Td> <Td> January 1, 1933--December 31, 1933 </Td> <Td> 1 year </Td> <Td> </Td> <Td> Democratic </Td> <Td> Surrogate of New York County </Td> </Tr> <Tr> <Th> 99 </Th> <Td> </Td> <Td> Fiorello H. La Guardia (1882--1947; aged 64) </Td> <Td> January 1, 1934--December 31, 1945 </Td> <Td> 12 years </Td> <Td> </Td> <Td> Republican </Td> <Td> U.S. Representative for New York (1922--1933) </Td> </Tr> <Tr> <Th> 100 </Th> <Td> </Td> <Td> William O'Dwyer (1890--1964; aged 74) </Td> <Td> January 1, 1946--August 31, 1950 </Td> <Td> 4 years, 243 days (4 years, 8 months) </Td> <Td> </Td> <Td> Democratic </Td> <Td> Brooklyn District Attorney (1939--1945) </Td> </Tr> <Tr> <Td> Acting </Td> <Td> </Td> <Td> Vincent R. Impellitteri (1900--1987; aged 86) </Td> <Td> August 31, 1950--November 14, 1950 </Td> <Td> 75 days </Td> <Td> </Td> <Td> Democratic (as acting mayor) </Td> <Td> President of the City Council (1945--1949) </Td> </Tr> <Tr> <Th> 101 </Th> <Td> November 14, 1950--December 31, 1953 </Td> <Td> 3 years, 48 days </Td> <Td> </Td> <Td> Experience Party (as elected mayor) </Td> <Td> Acting Mayor </Td> </Tr> <Tr> <Th> 102 </Th> <Td> </Td> <Td> Robert F. Wagner Jr . (1910--1991; aged 80) </Td> <Td> January 1, 1954--December 31, 1965 </Td> <Td> 12 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> 17th Borough President of Manhattan (1950--1953) </Td> </Tr> <Tr> <Th> 103 </Th> <Td> </Td> <Td> John Lindsay (1921--2000; aged 79) </Td> <Td> January 1, 1966--December 31, 1973 </Td> <Td> 8 years </Td> <Td> </Td> <Td> Republican </Td> <Td> U.S. Representative for New York (1959--1965) </Td> </Tr> <Tr> <Td> </Td> <Td> Democratic </Td> </Tr> <Tr> <Th> 104 </Th> <Td> </Td> <Td> Abraham Beame (1906--2001; aged 94) </Td> <Td> January 1, 1974--December 31, 1977 </Td> <Td> 4 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> 38th New York City Comptroller (1970--1973) </Td> </Tr> <Tr> <Th> 105 </Th> <Td> </Td> <Td> Ed Koch (1924--2013; aged 88) </Td> <Td> January 1, 1978--December 31, 1989 </Td> <Td> 12 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> U.S. Representative for New York (1973--1977) </Td> </Tr> <Tr> <Th> 106 </Th> <Td> </Td> <Td> David Dinkins (born in 1927; aged 91) </Td> <Td> January 1, 1990--December 31, 1993 </Td> <Td> 4 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> 23rd Borough President of Manhattan (1986--1989) </Td> </Tr> <Tr> <Th> 107 </Th> <Td> </Td> <Td> Rudy Giuliani (born in 1944; aged 74) </Td> <Td> January 1, 1994--December 31, 2001 </Td> <Td> 8 years </Td> <Td> </Td> <Td> Republican </Td> <Td> United States Attorney for the Southern District of New York (1983--1989) </Td> </Tr> <Tr> <Th> 108 </Th> <Td> </Td> <Td> Michael Bloomberg (born in 1942; aged 76) </Td> <Td> January 1, 2002--December 31, 2013 </Td> <Td> 12 years </Td> <Td> </Td> <Td> Republican </Td> <Td> CEO of Bloomberg L.P. (1981--2001) </Td> </Tr> <Tr> <Td> </Td> <Td> None </Td> </Tr> <Tr> <Th> 109 </Th> <Td> </Td> <Td> Bill de Blasio (born in 1961; aged 57) </Td> <Td> January 1, 2014--Incumbent </Td> <Td> 4 years </Td> <Td> </Td> <Td> Democratic </Td> <Td> 3rd New York City Public Advocate (2010--2013) </Td> </Tr> </Table> <Tr> <Th> #</Th> <Th> Portrait </Th> <Th> Name </Th> <Th> Term in office </Th> <Th> Length of service </Th> <Th_colspan="2"> Party affiliation </Th> <Th> Previous office </Th> </Tr>

Who were the last four mayors of new york city
find me the text answering this question