home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
DESKTOP
/
OPC12.ZIP
/
OPC.DOC
next >
Wrap
Text File
|
1993-03-02
|
2KB
|
47 lines
One-Page Calendar
Copyright (C) 1993 Kent Briggs
Version 1.2
OPC.EXE produces a full year calendar on a single sheet of paper for
a given year. Valid years are from 1583 to 9999. 1583 is the first
full year of the Gregorian (modern) calendar. You may send the output
to a file or to your HP or Epson compatible printer.
I wrote this program because I could only find one shareware/public
domain program that would produce output like I wanted with nice ASCII
line characters. However, that program asked you if it was a leap
year and what day of the week January 1 was on. I thought it was
ridiculous that the program did not make these calculations
automatically. It turns out that the calculations are not trivial
but can be made once you know the "rules" of the calendar.
Leap years are divisible by 4 except if they are divisible by 100
and not divisible by 400. So 1800 and 1900 were not leap years but
2000 will be because it is divisible by 400. The reason for all this
is because 3 adjustments need to be made every 400 years so that our
calendar stays synchronized with the seasons and the earth's position
around the sun. The tropical year is actually 365.2422 days in length.
Of course, it is necessary to know when leap years occur to determine
if February will have 28 or 29 days, but it is also needed to calculate
the day of the week for January 1. Since 365 divided by 7 has a
remainder of 1, the day of the week advances 1 day each year. So if
1/1/95 is a Sunday then 1/1/96 will be a Monday. However, if the
previous year was a leap year, an extra day was inserted so the day of
the week is advanced by 2. Thus 1/1/97 will be a Wednesday.
So with a known reference point, you need to know how many years
have passed and how many leap years occurred in that time. With
0=Sun and 6=Sat and x=year-1, the day of the week for January 1 of
any year is (1+x+(x div 4)-(x div 100)+(x div 400)) mod 7.
This program is copyrighted software but may be freely distributed.
No fee is required for continued use. If you have any suggestions
for improvement or find any bugs, please drop me a note at the address
below.
Kent Briggs
109A Romana Circle
Hewitt, TX 76643