Yes, calenders have some strange rules. Our common Gregorian calendar has a lot of legacy, e.g. the short february that has to be compensated by making other months longer. 12 months of 30 days each are obviously too short, leaving five or six days that have to be spread over the 12 months. Easy for leap years, choose every even or odd month. In non-leap years, remove the extra day from one of the months.

J. R. R. Tolkien had different ideas for Middle-earth. The stories of Middle-earth are fictional history for our real planet, so Middle-earth calendars also work for planet earth. The Shire calendar, used by the Hobbits, splits the year into 12 months of 30 days each. The remaining five or six days are not assigned to a month, they stay outside of the months. The year is split into two halves. Each of the halves is wrapped in two day of the remaining days. The middle of the year is marked by the fifth remaining day, and in case of a leap year, the leap day is inserted afther the mid-year's day. So there are two days outside the months in winter, when the year is incremented (compare to New Year's Eve and New Year) and three or four days in summer (no equivalent). A clever trick is that the mid-year's day and the leap day are not assigned a week day. This way, only 364 days are assigned a weekday, and because 364 is a multiple of seven, each year starts with the same weekday, and therefore, every day of the year has a fixed weekday.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^4: Calculating Number Of Pay Periods by afoken
in thread Calculating Number Of Pay Periods by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.