According to Calendrical Calculations by Ed Reingold and Nachum Dershowitz, 1700 and 1800 either were or weren't leap years, depending on the country in which you lived. The Gregorian calendar, currently used in the United States, was instituted by Pope Gregory xm in 1582, replacing the J ulian calendar. The Julian calendar - the one that simply put in a leap year every four years-made the year a tad too long, so the first day of spring - which gets measured astronomically - was sloooowly marching (pun intended) earlier.
By 1582, the vernal (spring) equinox was ten days early. It had continued to drift earlier since Caesar instituted the Ju1ian calendar in 45 B.C. until the Council of Nicea locked in the then-current alignment in A.D. 325. But between 325 and 1582, ten more days of error had accumulated.If something were not done, the first day of spring would slowly regress all through the year. Since the date of Easter depends on the vernal equinox, this would eventually force us to have both Easter and Christmas on the same day! Pope Gregory fixed this by tossing out leap years for three out of every four centuries, as I indicated; but he still had to deal with those extra ten days. So he declared that Thursday, October 4,1582, would be followed by Friday, October 15, 1582, to get the numbering right. The only problem was that the Catholic countries followed the pope's rule right away, while Protestant countries gradually adopted the new calendar.
In a nutshell, the year is now defined in terms of a certain number of vibrations of a cesium atom. But the "real" year is whatever the earth really does. Reality and the definition are slightly different, to the tune of about two milliseconds a day. So over the course of about 500 days, the error accumulates to about a full second. At that point, the Naval Observatory atomic clock inserts an extra second into time to keep the error under a full second. Although the USNO clock knows the time very accurately, it only reports the time to the second. The last leap second was inserted at the end of 1998, so there really was a time 11:59:60 on New Year's Eve in 1998!