Berkeley CSUA MOTD:Entry 34229
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/04/04 [General] UID:1000 Activity:popular
4/4     

2004/10/19-20 [Computer/SW/Languages] UID:34229 Activity:nil
10/19   I know leap years occur every 4 years, but there was some exception
        to that. Can anyone tell me what it was? I believe it involved years
        that were multiples of either 100 or 400. Thanks.
        \_ http://www.boulder.nist.gov/timefreq/general/leaps.htm
        \_ Year mod 4 == 0, leap year
           Year mod 100 == 0, no leap year
           Year mod 400 == 0, leap year
           ... possibly some other wrinkles.
           It basically come from the decimal expansion of the number of days
           in a year.  Of course the length of a day changes too...
           \_ More specifically if ((year%4 == 0 && year%100 !=0) || year%400
              ==0) leapyear = TRUE; else leapyear = FALSE;
              \_ Ergh, don't write
                    if (bool) x = true; else x = false;
                 statements!  Just set x = bool!
        \_ The above is right, and there are no other wrinkles.  Incidentally,
           this calendar was chosen because it was the most accurate system
           they could get the monks (who kept time back in the day) to
           actually memorize without error. -- ilyas
           \_ Every once in a while you'll see a leap second added.
              \_ Ok, that must be a latter addition to the original
                 calendar.  My mistake. -- ilyas
Cache (2120 bytes)
www.boulder.nist.gov/timefreq/general/leaps.htm
Leap years are years with 366 days, instead of the usual 365. Basically, leap years occur every 4 years, and years that are evenly divisible by 4 (2004, for example) have 366 days. This extra day is added to the calendar on February 29th. However, there is one exception to the leap year rule involving century years, like the year 1900. For this reason, only 1 out of every 4 century years is considered as a leap year. Century years are only considered as leap years if they are evenly divisible by 400. Therefore, 1700, 1800, 1900 were not leap years, and 2100 will not be a leap year. But 1600 and 2000 were leap years, because those year numbers are evenly divisible by 400. The year 2000 was a leap year, and February 29, 2000 has come and go ne. Even though 2000 was a century year, it was also a leap year because 2000 is evenly divisible by 400. A leap second is a second added to Coordinated Universal Time (UTC) to ma ke it agree with astronomical time to within 09 second. UTC is an atomic time scale, based on the performance of atomic clocks. Astronomical time is based on the rate of rotation of the earth. Since atomic clocks are more stable than the rate at which the earth rotates, leap seconds are needed to keep the two time scales in agreement. The first leap second was added on June 30, 1972, and they occur at a rate of slightly less than one per year, on average. Although it is possible to have a negative leap second (a second removed from UTC), so far, all leap seconds have been positive (a second has been added to UTC). Based on what we know about the earth's rotation, it is unlikely that we will ever have a negative leap second. Leap seconds are needed so that users of the astronomical time scale (UT1 ) can use UTC and know that the difference between the two time scales is never greater than 09 seconds. Currently the difference between UT1 and UTC is changing at a rate of about 2 to 3 milliseconds per day, which makes a leap second necessary at an average interval of slightly more than 1 year. Historically, leap seconds have only been implemented on June 30th or December 31st.