home *** CD-ROM | disk | FTP | other *** search
/ Big Blue Disk 22 / bbd22.zip / DATES.TXT < prev    next >
Text File  |  1988-05-20  |  10KB  |  178 lines

  1. |D╔══════════════════╗════════════════════════════════════════════════════════════
  2. |D║ |5The Happy Hacker |D║════════════════════════════════════════════════════════════
  3. |D╚══════════════════╝════════════════════════════════════════════════════════════
  4.  
  5. ^C^1Dates
  6. ^C(DHDATES.OBJ & DHDATES3.OBJ)
  7. ^Cby
  8. ^CDan Harrison
  9.  
  10.    Dhdates & Dhdates3 are subprograms designed to be used with Microsoft 
  11. QuickBASIC version 3.0 -- DHDATES is used with the BCOM30 library, and DHDATES3 
  12. is used with the BRUN30 library. 
  13.  
  14.    Have you ever wondered why BASIC just can't handle dates properly. Oh yes, it 
  15. will give you the current date and even build a date from the month, day, and 
  16. year.  But what if you want more in your programs?  Like what day of the week is 
  17. it?  How about dates before 1980?  How many days between two dates?  What is the 
  18. true Julian date?  How about a date format which humans are used to?  When is 
  19. Easter in the year 2045 or when was Washington's birthday in 1912?  Dhdates can 
  20. do this and so much more - AND very quickly and easily in your own custom built 
  21. QuickBasic compiled programs.  Dhdates gives accurate information for years 
  22. inclusive of 1900 to 2100. 
  23.  
  24.    The calling syntax for Dhdates (or Dhdates3) is
  25.  
  26.    CALL DHDATES(OPERATION%,JD!,WEEK%,ZDATE$,JDAY%,MONTH%,DAY%,YEAR%,YDATE$)
  27.  
  28.    After compiling your program containing a call to Dhdates, link your program 
  29. with Dhdates in the following manner (example: your program name in this 
  30. example is `yourprogram'): 
  31.  
  32.         LINK yourprogram+DHDATES
  33.  
  34.  
  35.    The following information will be returned from each call to Dhdates: 
  36.  
  37.       1.  JD! - this is the true Julian date where the Julian date
  38.                 of 1 was January 1, -4713 when three astrological
  39.                 events occurred simultaneously.  JD! returns -1 if
  40.                 an error of input has been detected (such as a date
  41.                 outside of the range indicated above).
  42.       2.  Week% - this is the day of the week where 0 is Sunday and
  43.                 6 is Saturday.
  44.       3.  Zdate$ -  this is the normal computer composite date in 
  45.                 the form of 02-19-1988.
  46.       4.  Jday% - this is the day of the year where January 1 is 1
  47.                 and December 31 is either 365 or 366 depending on
  48.                 if it is leap year.
  49.       5.  Month% - this is the month which is a number from 1 to 12.
  50.       6.  Day% - this is the day of the month which is a number from
  51.                 1 to 31 depending on the month.
  52.       7.  Year% - this is the year as a number from 1900 to 2100.
  53.       8.  Ydate$ - this is a more elegant form of the date such as
  54.                 December 12, 1955.
  55.  
  56.   Call variables:
  57.  
  58.       o  Operation% - a number from 1 to 7 -- see the table below.
  59.       o  JD! - a single precision number.  range 2415021 to 2488434.
  60.       o  Week% - an integer of the day of the week from 0 to 6.
  61.       o  Zdate$ - a composite date such as 02-17-1977.
  62.       o  Jday% - an integer for the day of the year (or holiday code).
  63.       o  Month% - an integer for the month from 1 to 12.
  64.       o  Day% - an integer for the day of the month from 1 to 31.
  65.       o  Year% - an integer for the year from 1900 to 2100.
  66.       o  Ydate$ - a returned string only.
  67.  
  68.               NOTE:  this is a list of all the variables used to 
  69.                       call or return from Dhdates.  Only the
  70.                       variables listed in the table need to be sent
  71.                       to the subroutine, however all the variables
  72.                       are returned from the subroutine.
  73.  
  74. OPERATION CODES:  (send these variables to the subprogram)
  75. ╔═════════════════════════════════════════════════════════════════════════════╗
  76. ║ Function  Operation%   JD  Week%  Zdate$  Jday%  Month%  Day%  Year%  Ydate$║
  77. ║                                                                             ║
  78. ║Convert                             Date                                     ║
  79. ║Gregorian      1         -    -      to      -      -      -      -      -   ║
  80. ║to Julian                          convert                                   ║
  81. ║                                                                             ║
  82. ║Find date                                                                    ║
  83. ║X days         2         -    -     Start    -     #days   -      -      -   ║
  84. ║to/from                                                                      ║
  85. ║a date                                                                       ║
  86. ║                                                                             ║
  87. ║Find week-                                                                   ║
  88. ║day in                       Day     Date                                    ║
  89. ║a week         3         -  of the  in the   -      -      -      -      -   ║
  90. ║containing                   week    week                                    ║
  91. ║the date                                                                     ║
  92. ║                                                                             ║
  93. ║Convert                Julian                                                ║
  94. ║Julian         4        date  -       -      -      -      -      -      -   ║
  95. ║  to                                                                         ║
  96. ║Gregorian                                                                    ║
  97. ║                                                                             ║
  98. ║Build a                                                                      ║
  99. ║date from      5         -    -       -      -    Month   Day   Year     -   ║
  100. ║month, day,                                                                  ║
  101. ║and year                                                                     ║
  102. ║                                                                             ║
  103. ║Find date                                                                    ║
  104. ║  of a         6         -    -       -   Holiday   -      -    Year     -   ║
  105. ║ holiday                                 see chart                           ║
  106. ║                                                                             ║
  107. ║Find date                                                                    ║
  108. ║from day       7         -    -       -    Day of   -      -    Year     -   ║
  109. ║of year                                                                      ║
  110. ╚═════════════════════════════════════════════════════════════════════════════╝
  111.  
  112. HOLIDAYS  (Operation%=6)
  113.           
  114.                   JDAY%           Holiday                 Date Calculated
  115.                   ─────       ──────────────              ───────────────
  116.           1         New Year's Day              January 1
  117.           2         Groundhog Day               February 2
  118.           3         Lincoln's Birthday          February 12
  119.           4         Valentine's Day             February 14
  120.           5         President's Day             3rd Monday in February
  121.           6         Washington's B'day          February 20
  122.           7         St. Patrick's Day           March 17
  123.           8         April Fool's Day            April 1
  124.           9         Ash Wednesday               40 Days before Easter
  125.          10         Palm Sunday                 Sunday before Easter
  126.          11         Good Friday                 Friday before Easter
  127.                                                 1st Sunday after the
  128.          12         Easter                      1st full moon after the
  129.                                                 Spring Equinox
  130.          13         Arbor Day                   Last Friday in April
  131.          14         May Day                     May 1
  132.          15         Mother's Day                2nd Sunday in May
  133.          16         Armed Forces Day            3rd Saturday in May
  134.          17         Memorial Day (celebrated)   Last Monday in May
  135.          18         Memorial Day (actual)       May 30
  136.          19         Father's Day                3rd Sunday in June
  137.          20         Independence Day            July 4
  138.          21         Labor Day                   1st Monday in September
  139.          22         Grandparent's Day           1st Sunday after Labor Day
  140.          23         Columbus Day                2nd Monday in October
  141.          24         Halloween                   October 31
  142.          25         All Saint's Day             November 1
  143.          26         Election Day                1st Tuesday after the
  144.                                                 1st Monday in November
  145.          27         Veteran's Day               November 11
  146.          28         Thanksgiving                4th Thursday in November
  147.          29         Christmas                   December 25
  148.          30         New Year's Eve              December 31
  149.  
  150.  
  151. Two programs have been included here as a demonstration of what can be done
  152. using the Dhdates subprogram:
  153.  
  154. DATEDEMO
  155. ────────
  156.  
  157.    Datedemo is a demonstration program of each of the call parameters shown 
  158. above.  It allows you to see the speed and accuracy of the Dhdates subprogram 
  159. and may give some insights to it's usefulness. 
  160.  
  161.    Initiate the Date Demo by typing `DATEDEMO' while in DOS, or selecting "Run 
  162. It" from the BIG BLUE DISK menu.  The DATEDEMO.EXE file must be on the current 
  163. drive and directory since some data is read directly from the EXE file. 
  164.  
  165.  
  166. CALENDAR
  167. ────────
  168.  
  169.    See "Read It" text for Calendar program in the Helpware department for more 
  170. information about this program.
  171.  
  172. DISK FILES THIS PROGRAM USES:
  173. ^FDHDATES.OBJ
  174. ^FDHDATES3.OBJ
  175. ^FDATEDEMO.EXE
  176. ^FBRUN30.EXE
  177. ^FRETURN30.EXE
  178.