Announcement

Collapse
No announcement yet.

Leap Year - It's Not Just Divisible By 4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Leap Year - It's Not Just Divisible By 4

    Here's a definition I never saw before:

    A leap year is defined as all years divisible by 4, except for years divisible by 100 that are not also divisible by 400.
    i.e., 1900 is not a leap year.

    Once I read it, I looked around and sure enough that's the definition. My whole life growing up in Oklahoma, the divide by 4 was all I remember hearing.

    I guess if I had to program a function from scratch (like I'm doing today) I might have noticed it before.

    Funny how life is like that - unless you're interested in something, it can simply pass you by.

  • #2
    Don't forget that occasional leap second too
    <b>George W. Bleck</b>
    <img src='http://www.blecktech.com/myemail.gif'>

    Comment


    • #3
      fyi

      User to user discussion about the PowerBASIC for DOS product line. Includes discussions about PBDK, QuickPak Pro, PB/Vision, PB/Xtra, and PowerTree for DOS.
      p purvis

      Comment


      • #4
        Hi Gary,

        Originally posted by Gary Beene View Post
        ...program a function from scratch (like I'm doing today) I might have noticed it before.
        Save yourself some time and effort, Egbert Zijlema has already done all the hard work, see is excellent work at:

        http://zijlema.basicguru.eu/

        Or, if you also have a need for a database, you can use the SQLite date functions, see :

        http://planetsquires.com/support/index.php?topic=3061.0

        and

        http://www.sqlite.org/lang_datefunc.html
        Regards,
        Marc

        Comment


        • #5
          A solar year is 365 days 5 hours 48 minutes and 45.5 seconds or 365.242193 so the 'every four' obviously needed tweaking. However, the tweak isn't perfect and we'll have to cancel a leap year every 3257 years - a big step for man but a small step for the universe.

          Comment


          • #6
            cancel a leap year every 3257 years
            canceled day.... hmmm maybe my boss would let me off that day... anyone know when the next one is? If not I can pick one.

            "I haven't lost my mind... its backed up on tape... I think??" :D

            Comment


            • #7
              I hate to be the bearer of bad tidings William but I reckon that clock started ticking in 1582 when the Gregorian calendar was introduced and, if memory serves, a 12 day shuffle was applied as its predecessor the Julian calendar, introduced in 46BC, was working on the 'every four' rule. So, 2832 would be my guess for ignoring that leap year. Would that fit in with your plans?

              Comment


              • #8
                And the 400 year rule is why the year 2000 was not the computer calamity many expected. Older PC bios's and many other programs only used the divide by 4 rule. As 2000 was a leap year it didn't really matter to them.

                Comment

                Working...
                X