|> Cute algorithm... but its just another example of what

|> doesn't work in the *very* near future!

|>

|> I do remember seeing something not too long ago and I may

|> have even saved it(!) Will give a good look after my

|> stomach "recovers" from Turkey day ;-)

|>

|> -michael

|>

|> : >Could someone explain to me how to obtain the current day-of-week in

|> : >an assembler program? I'm most interested in /370, but just about any

|> : >generation would work...

|> : I saved this message from another universe a long, long time ago.

|> : >Try this:

|> : > (year + year/4 + date of month + factor for month) / 7

|> : >(where year is the last two digits)

|> : >factor for month =

|> : >Jan: 1 (0 if leap year)

|> : >Feb: 4 (3 if leap year)

|> : >Mar: 4

|> : >Apr: 0

|> : >May: 2

|> : >Jun: 5

|> : >Jul: 0

|> : >Aug: 3

|> : >Sep: 6

|> : >Oct: 1

|> : >Nov: 4

|> : >Dec: 6

|> : >

|> : >Now... when you perform the division shown above, the day of the week

|> : >is determined by the remainder. (We don't care about the rest of the answer)

|> : >

|> : >Remainder of 1 = Sunday

|> : >Remainder of 2 = Monday

|> : > 3 = Tuesday

|> : > 4 = Wednesday

|> : > 5 = Thursday

|> : > 6 = Friday

|> : > 0 = Saturday

|>

|> --

|> -----------------------------------------------------

|> "Just because it worked doesn't mean it works." -- me

The algorithm will work in the future - with a few additions.

1. The "year" refers to the last two digits of the full year. For 1945, use 45.

2. Add the following factors:

17nn : + 4

18nn : + 2

19nn : + 0

20nn : + 6 (or - 2)

3. I learned to do this algorithm in my head forty years ago. You can do modulo 7 reductions after the "year + year/4" to make it easier. I use the folowing clues to help remember the month factors.

Jan: 1 First

Feb: 4 Cold (4 letters)

Mar: 4 Wind (4 letters)

Apr: 6 Shower (6 letters)

May: 2 May Day (two words)

Jun: 5 Bride (5 letters)

Jul: 7 Cracker (7 letters) (7 Mod(7) = 0)

Aug: 3 Hot (3 letters)

Sep: 6 Autumn (6 letters)

Oct: 8 Eighth (8 mod(7) = 1)

Nov: 4 Cool (4 letters)

Dec: 6 Christ (6 Letters)

Note that the the Gregorian Calendar began on Sept. 14, 1752. Prior to then, the Julian calendar was used in which every century year was a leap year. In the Gregorian, only century years evenly divisible by 400 are leap years.

The calendars differ because in Julius Caesar's time in the century before Christ, calculations of the solar year were slightly off - 365.5 days rather

than the precise 365.2421999.

Over the centuries those lagging minutes turned into days.

When Pope Gregory XIII ordered reforms in the 16th century to bring the calendar in sync with the sun and the seasonal holy days, the lag was 10 days. In his decree introducing the corrected calendar, the Julian date of Oct. 5, 1582, became Oct. 15 under the new style.

When Britain and its empire adopted the Gregorian system, the date Sept. 3, 1752, under the old calendar became Sept. 14 under the new - a lag of 11 days. Occasional conflicts between old style-new style dates occur. For example, Columbus landed in the New World on Oct. 12, 1492, a date celebrated under the

Gregorian calendar. But some authorities say that's a Julian date that was never changed to the new style. They maintain the new-style date should be Oct. 21.

Many more complications exist for dates prior to Sept. 14, 1752. For example, from the 7th until around the 13th century, the year was reckoned as beginning at Christmas. In the 12th century, however, the Anglican church took a more seminal approach, worked back one human gestation period from 25 December, and arrived at 25 March as the Feast of the Annunciation, or Lady Day, as the true beginning of the year. Kinda explains why SEPTEMber, OCTOber, NOVEMber and DECEMber are not the 7th to 10th months.

By the 14th century, 25 March had been generally adopted as the first day ofthe civil or legal year. Until 1752, this coexisted with the concept of the historical year, which began on 1 January, so dates in the early months were frequently given in the form 24 March 1694/5, with the final fraction digit showing both legal and historical year.

The January/March problem dated back to Roman days, where the original calendar, supposedly drawn up by Romulus, ran from March to December with January and February ignored. From 222BC, the year ran from March, when the new consul took office, but in 153BC New Year's Day was changed to 1 January.

It's not BAL, but may help explain the algorithm.