home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / o / opc12.zip / OPC.DOC next >
Text File  |  1993-03-02  |  2KB  |  47 lines

  1.  
  2.                              One-Page Calendar
  3.                        Copyright (C) 1993 Kent Briggs
  4.                                 Version 1.2
  5.  
  6.      OPC.EXE produces a full year calendar on a single sheet of paper for
  7.      a given year.  Valid years are from 1583 to 9999. 1583 is the first
  8.      full year of the Gregorian (modern) calendar.  You may send the output
  9.      to a file or to your HP or Epson compatible printer.
  10.  
  11.      I wrote this program because I could only find one shareware/public
  12.      domain program that would produce output like I wanted with nice ASCII
  13.      line characters.  However, that program asked you if it was a leap
  14.      year and what day of the week January 1 was on.  I thought it was
  15.      ridiculous that the program did not make these calculations
  16.      automatically.  It turns out that the calculations are not trivial
  17.      but can be made once you know the "rules" of the calendar.
  18.  
  19.      Leap years are divisible by 4 except if they are divisible by 100
  20.      and not divisible by 400.  So 1800 and 1900 were not leap years but
  21.      2000 will be because it is divisible by 400.  The reason for all this
  22.      is because 3 adjustments need to be made every 400 years so that our
  23.      calendar stays synchronized with the seasons and the earth's position
  24.      around the sun.  The tropical year is actually 365.2422 days in length.
  25.  
  26.      Of course, it is necessary to know when leap years occur to determine
  27.      if February will have 28 or 29 days, but it is also needed to calculate
  28.      the day of the week for January 1.  Since 365 divided by 7 has a
  29.      remainder of 1, the day of the week advances 1 day each year.  So if
  30.      1/1/95 is a Sunday then 1/1/96 will be a Monday.  However, if the
  31.      previous year was a leap year, an extra day was inserted so the day of
  32.      the week is advanced by 2.  Thus 1/1/97 will be a Wednesday.
  33.  
  34.      So with a known reference point, you need to know how many years
  35.      have passed and how many leap years occurred in that time. With
  36.      0=Sun and 6=Sat and x=year-1, the day of the week for January 1 of
  37.      any year is (1+x+(x div 4)-(x div 100)+(x div 400)) mod 7.
  38.  
  39.      This program is copyrighted software but may be freely distributed.
  40.      No fee is required for continued use.  If you have any suggestions
  41.      for improvement or find any bugs, please drop me a note at the address
  42.      below.
  43.  
  44.      Kent Briggs
  45.      109A Romana Circle
  46.      Hewitt, TX  76643
  47.