home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / date-33.087.lha / Date-33.087 / Amiga / Oberon / txt / Date.doc < prev    next >
Encoding:
Text File  |  1994-04-13  |  57.1 KB  |  2,481 lines

  1. TABLE OF CONTENTS
  2.  
  3. Date/--background--
  4. Date/--history--
  5. Date/GregorianDayDiff
  6. Date/GregorianDayGreater
  7. Date/GregorianDaysAfterWeekday
  8. Date/GregorianDaysBeforeWeekday
  9. Date/GregorianDaySmaller
  10. Date/GregorianDiffDate
  11. Date/GregorianEaster
  12. Date/GregorianLeapYear
  13. Date/GregorianMonthDays
  14. Date/GregorianMoonAge
  15. Date/GregorianToJD
  16. Date/GregorianWeek
  17. Date/GregorianWeekday
  18. Date/GregorianYearDays
  19. Date/GSYearToJD
  20. Date/GYearToScaliger
  21. Date/HeisDayDiff
  22. Date/HeisDayGreater
  23. Date/HeisDaysAfterWeekday
  24. Date/HeisDaysBeforeWeekday
  25. Date/HeisDaySmaller
  26. Date/HeisDiffDate
  27. Date/HeisLeapYear
  28. Date/HeisMonthDays
  29. Date/HeisToJD
  30. Date/HeisWeek
  31. Date/HeisWeekday
  32. Date/HeisYearDays
  33. Date/HSYearToJD
  34. Date/HYearToScaliger
  35. Date/JDtoMJD
  36. Date/JDToTime
  37. Date/JSYearToJD
  38. Date/JulianDayDiff
  39. Date/JulianDayGreater
  40. Date/JulianDaysAfterWeekday
  41. Date/JulianDaysBeforeWeekday
  42. Date/JulianDaySmaller
  43. Date/JulianDiffDate
  44. Date/JulianLeapYear
  45. Date/JulianMonthDays
  46. Date/JulianToJD
  47. Date/JulianWeek
  48. Date/JulianWeekday
  49. Date/JulianYearDays
  50. Date/JYearToScaliger
  51. Date/LMT
  52. Date/MJDtoJD
  53. Date/ScaligerYearToG
  54. Date/ScaligerYearToH
  55. Date/ScaligerYearToJ
  56. Date/SecToTime
  57. Date/TimeToJD
  58. Date/GregorianEaster
  59. Date/TimeToSec
  60. Date/TimeZoneFactor
  61. Date/--background--                                       Date/--background--
  62.  
  63.    NAME
  64.     Date -- This module was designed to help calc. calendar dates (V33)
  65.  
  66.    FUNCTION
  67.     I now about the date routines in the Amiga-OS(TM), but i decided
  68.     not to use them, because of their limited functionality and of
  69.     the portability of this Module!
  70.  
  71.    NOTES
  72.     A tropical year is 365.2422 days! / 365d, 5h, 48min, 46sec
  73.     A moon month is 29.53059 days! / 29d, 12h, 44min, 2.9 sec
  74.     A moon phase is 7.38265 days!
  75.  
  76.     (german) Books who helped me creating this:
  77.         Kleine Naturwissenschaftliche Bibliothek, Band 23
  78.         Ewige Kalender
  79.         A.W. Butkewitsch & M.S. Selikson
  80.         5. Auflage
  81.         Teubner, Leipzig 1974
  82.         ISBN 3-322-00393-0
  83.  
  84.         Tag und Woche, Monat und Jahr: eine Kulturgeschichte des
  85.         Kalenders
  86.         Rudolf Wendorff
  87.         Westdeutscher, Opladen 1993
  88.         ISBN 3-531-12417-X
  89.  
  90.         Kalender und Chronologie: Bekanntes & Unbekanntes aus der
  91.         Kalenderwissenschaft
  92.         Heinz Zemanek
  93.         4. Auflage
  94.         Oldenbourg, München 1987
  95.         ISBN 3-486-20447-5
  96.  
  97.         Meyers Handbuch
  98.         über das Weltall
  99.         Karl Schaifers & Gerhard Traving
  100.         5. Auflage
  101.         Bibliographisches Institut Mannheim 1973
  102.         ISBN 3-411-00940-3
  103.  
  104.     (english) Books who helped me creating this:
  105.         Mathematical Astronomy with a Pocket Calculator
  106.         Aubrey Jones Fras
  107.         unknown(first) Edition
  108.         David & Charles Newton Abbot, London 1978
  109.         ISBN 0-7153-7675-6
  110.  
  111.    COPYRIGHT
  112.     This module is Copyright 1994 by Kai Hofmann - all rights reserved!
  113.     For private use, Public Domain, Gift Ware, Freeware and Shareware
  114.     you could use this module under following conditions:
  115.     - You send me a little gift (money is very welcome :)
  116.         For Bank Accocunt see below - but *ONLY* send in DM
  117.         to this Bank Account!!!
  118.       Other nice gifts: all Amiga hardware, and i am searching for a
  119.       good old 1541 (C64 floppy)
  120.     - You include a notice in your product, that you use this library
  121.       and that it is Copyright by Kai Hofmann!
  122.     If you want to redistribute this library read the following points:
  123.     - Redistribution warranty is given to:
  124.         Fred Fish for his great Amiga-Software-Library
  125.         The german SAAR AG PD-Library
  126.         The german AMOK PD-Library
  127.         All public accessible INTERNET servers and PHONE boxes!
  128.         All other who NOT take more than DM 5.- for one disk
  129.         ALL other who NOT take more than DM 50.- for one CD
  130.     For commercial use send me DM 200.-
  131.     But if you are Apple or Microsoft you have to send (20000.- US$)
  132.  
  133.    DISCLAIMER
  134.  
  135.       THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  136.    APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  137.    HOLDER AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
  138.    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  139.    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  140.    PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  141.    PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
  142.    COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  143.  
  144.       IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  145.    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY REDISTRIBUTE THE
  146.    PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
  147.    GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  148.    USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
  149.    OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
  150.    THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  151.    PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  152.    POSSIBILITY OF SUCH DAMAGES.
  153.  
  154.    ADDITIONAL INFORMATIONS
  155.     I have tried to make portable/usefull and i hope bugfree software
  156.     for eternity - but this seems to be impossible (sorry!) :)
  157.     So i hope YOU will pay a fee for this.
  158.  
  159.    AUTHOR
  160.     Kai Hofmann
  161.     Arberger Heerstraße 92
  162.     28307 Bremen
  163.     Germany
  164.     EMail: i07m@alf.zfn.uni-bremen.de
  165.     (no phone - i hate it!)
  166.  
  167.     Bank account : 1203 7503
  168.     Account owner: Kai Hofmann
  169.     Bank code    : 290 501 01
  170.     Bank name    : Sparkasse in Bremen
  171.     Bank address : 28307 Bremen / Germany
  172.  
  173. Date/--history--                                             Date/--history--
  174.  
  175.    NAME
  176.     history -- This is the development history of the Date module
  177.  
  178.    VERSION
  179.     $VER: Date 33.087 (10.04.1994)
  180.  
  181.    HISTORY
  182.     16.01.1994 -    Procedures: JulianLeapYear, GregorianLeapYear &
  183.             HeisLeapYear initiated.
  184.     22.01.1994 -    Procedures: JulianMonthDays, GregorianMonthDays,
  185.             HeisMonthDays, JulianYearDays, GregorianYearDays,
  186.             HeisYearDays, JulianDayDiff, GregorianDayDiff,
  187.             HeisDayDiff, JulianDaySmaller, GregorianDaySmaller,
  188.             HeisDaySmaller, JulianWeekday, GregorianWeekday,
  189.             HeisWeekday, JulianDaysBeforeWeekday,
  190.             GregorianDaysBeforeWeekday, HeisDaysBeforeWeekday,
  191.             JulianDaysAfterWeekday, GregorianDaysAfterWeekday,
  192.             HeisDaysAfterWeekday JulianDiffDate, FreeDate
  193.             initiated.
  194.             Types: Weekdays, Date, DatePtr initiated.
  195.             Vars of Gregorian reform initiated
  196.             (for changing to different countries)
  197.     23.01.1994 -    Procedures: JulianDiffDate finished,
  198.             GregorianDiffDate, HeisDiffDate, JYearToScaliger,
  199.             GYearToScaliger, HYearToScaliger, ScaligerYearToJ,
  200.             ScaligerYearToG, ScaligerYearToH, JSYearToJD,
  201.             GSYearToJD, HSYearToJD, JDtoMJD, MJDtoJD, JulianToJD,
  202.             GregorianToJD, HeisToJD, TimeToJD, JDToTime, FreeTime
  203.             initiated.
  204.             Types: Time, TimePtr initiated.
  205.     28.01.1994 -    Procedures: GregorianMoonAge, MoonMonthAge,
  206.             GregorianEaster initiated.
  207.     30.01.1994 -    Procedures: JulianDiffDate, GregorianDiffDate,
  208.             HeisDiffDate, JDtoTime, GregorianEaster edited
  209.             (changing return value from ptr to VAL variables).
  210.             Procedures: FreeDate, FreeTime deleted.
  211.             Types: Date, DatePtr, Time, TimePtr deleted (not
  212.             longer needed, because of the procedure changes).
  213.             Procedures: GregorianMoonAge, GregorianEaster changed
  214.             year parameter from CARDINAL to INTEGER (this is more
  215.             consistent to the rest of the library).
  216.             Bugs removed: GregorianWeekday, HeisWeekday
  217.             (before removing, the weekday for leapyears was
  218.             wrong)
  219.             Procedure: GregorianEaster finished.
  220.     30.01.1994 -    Ported to Oberon-2
  221.     31.01.1994 -    Compiled with Oberon-2 V3.11
  222.     12.02.1994 -    Procedures: TimeZoneFactor, LMT, TimeToSec, SecToTime
  223.             initiated.
  224.             Version-String installed :)
  225.     12.02.1994 -    Starting translation to SAS C 6.51
  226.             Date.h translated
  227.     13.02.1994 -    Continuation of C translation
  228.     17.02.1994 -    New Oberon-2 Port, because yesterday Daniel Armor
  229.             gives me a little hint about the SHORT command
  230.             (i was not knowing about this!)
  231.     17.02.1994 -    Little bug in Autodocs removed
  232.             making this text as Date/--history-- autodoc
  233.     17.02.1994 -    Continuation of C translation
  234.     18.02.1994 -    Finished with C translation
  235.     19.02.1994 -    C bugs removed (thanx to SAS for helping a C Lamer
  236.             like me!), some optimizations done too.
  237.     19.02.1994 -    Oberon-2 version compiled with V40.17 includes
  238.     21.02.1994 -    Writing Modula-II testmodule
  239.             Vars for the begining of Heis calculation initiated.
  240.             Fixed little bugs in GregorianWeekday, HeisWeekday,
  241.             TimeToSec, SecToTime
  242.             Return-value of LMT changed to LONGINT!
  243.             Converting testmodule to Oberon-2
  244.     22.02.1994 -    Converting testmodule to C
  245.     23.02.1994 -    I noticed, that i forgot the 3 funktions
  246.             JulianWeek, GregorianWeek, HeisWeek
  247.     24.02.1994 -    Initiated the 3 forgotten funktions
  248.     26.02.1994 -    Initiating new GregorianEastern with Gauß-algorithms
  249.             but ONLY for 1900-2099!
  250.     27.02.1994 -    Bug fixed in JulianWeekday
  251.             Bugs fixed in JulianDayDiff, GregorianDayDiff,
  252.             HeisDayDiff
  253.             JulianDayGreater, GregorianDayGreater,
  254.             HeisDayGreater Initiated.
  255.     02.03.1994 -    Little bug fixed in HeisdayDiff
  256.             Bugs from 27.02. fixed in Modula-II and Oberon-2
  257.             versions
  258.             I found the way to extend Gregorian Easter!
  259.             Little bug fixed in JulianWeek, GregorianWeek,
  260.             HeisWeek (~(M2) is not !(C))
  261.     05.03.1994 -    Some internal bugs removed
  262.             New internal procedures GregorianSB,
  263.             GregorianJHSB, GregorianJHStartSB!
  264.             Extending GregorianEaster :)
  265.     11.03.1994 -    Things from 05.03. done in Modula-II and Oberon
  266.     12.03.1994 -    If __SASC is defined autoinitalization instead of
  267.             _DateInit will be used!
  268.     13.03.1994 -    After studying the SAS C Manual again i decided to
  269.             check for __SASC_650 instead of __SASC because of
  270.             the available of priorities!
  271.             Setting the priority of _DateInit for
  272.             autoinitalization to 600!
  273.     15.03.1994 -    Making Date as library
  274.     16.03.1994 -    Some work on the Autodocs was done
  275.             Eleminating OldGregorianEaster by comments
  276.             (ANSI: STOP bad standards like that there are NO
  277.              nestedcomments possible in C!!!)
  278.     19.03.1994 -    Some work on the Autodocs was done in the M2 Code
  279.     20.03.1994 -    Some work on the Autodocs was done in the Oberon Code
  280.     22.03.1994 -    In JDtoMJD, MJD to JD an L was added to the constant
  281.             In GregorianWeekday(), HeisWeekday(),
  282.             JulianDiffDate(), GregorianDiffDate(),
  283.             HeisDiffDate(), JDToTime() i have inserted
  284.             conversions (found with Borland C++ 4.0)
  285.     24.03.1994 -    Making SunOS4.1.3, SunOS5.3(Solaris2.3) &
  286.             RS6000 AIX3.2.? binaries with gcc
  287.             Eliminating nested commends by inserting a space
  288.             between / and * (i hate this ANSI C standard
  289.             feature for commends :(
  290.     27.03.1994 -    Adding library register assignments to the autodocs
  291.     03.04.1994 -    Little fixes for the SAS C++ Compiler
  292.             Little bug fixed in the M2 version of GregorianEaster
  293.     10.04.1994 -    Changing from Shareware to Gift Ware ;-)
  294.  
  295. Date/GregorianDayDiff                                   Date/GregorianDayDiff
  296.  
  297.    NAME
  298.     GregorianDayDiff -- Calculates the days between 2 dates. (V33)
  299.  
  300.    SYNOPSIS
  301.     days := GregorianDayDiff(day1,month1,year1,day2,month2,year2);
  302.  
  303.     PROCEDURE GregorianDayDiff(day1,month1 : SHORTINT; year1 : INTEGER;
  304.         day2,month2 : SHORTINT; year2 : INTEGER) : LONGINT;
  305.  
  306.    FUNCTION
  307.     GregorianDayDiff gives you back the number of days between
  308.     two specified dates.
  309.  
  310.    INPUTS
  311.     day1   - day of the first date
  312.     month1 - month of the first date
  313.     year1  - year of the first date
  314.     day2   - day of the second date
  315.     month2 - month of the second month
  316.     year2  - year of the second date
  317.  
  318.    RESULT
  319.     days - The number of days between the two dates
  320.         (positive if date1 <= date2).
  321.  
  322.    EXAMPLE
  323.     ...
  324.     days := GregorianDayDiff(18,9,1970,22,1,1994);
  325.     WriteString("Age of Kai Hofmann in days : ");
  326.     WriteInt(days,10); WriteLn;
  327.     ...
  328.  
  329.    NOTES
  330.     Its is better only to use this function for years from -7 to 3200!
  331.  
  332.    BUGS
  333.     If you use on of the dates 5.10.1582 to 14.10.1582 you will become
  334.     wrong output, because this days don't exist!
  335.  
  336.    SEE ALSO
  337.     JulianDayDiff(),HeisDayDiff(),GregorianDaySmaller(),
  338.     GregorianDayGreater(),GregorianMonthDays(),GregorianYearDays()
  339.  
  340. Date/GregorianDayGreater                             Date/GregorianDayGreater
  341.  
  342.    NAME
  343.     GregorianDayGreater -- Checks if date1 is great than date2. (V33)
  344.  
  345.    SYNOPSIS
  346.     greater := GregorianDayGreater(day1,month1,year1,day2,month2,year2);
  347.  
  348.     PROCEDURE GregorianDayGreater(day1,month1 : SHORTINT;
  349.         year1 : INTEGER; day2,month2 : SHORTINT;
  350.         year2 : INTEGER) : BOOLEAN;
  351.  
  352.    FUNCTION
  353.     GregorianDayGreater test if date1 is greater than date2.
  354.  
  355.    INPUTS
  356.     day1   - day of the first date
  357.     month1 - month of the first date
  358.     year1  - year of the first date
  359.     day2   - day of the second date
  360.     month2 - month of the second month
  361.     year2  - year of the second date
  362.  
  363.    RESULT
  364.     greater - This is TRUE is date1 > date2 otherwise it's FALSE.
  365.  
  366.    EXAMPLE
  367.     ...
  368.     IF GregorianDayGreater(18,9,1970,22,1,1994) THEN
  369.       WriteString(">"); WriteLn;
  370.     ELSE
  371.       WriteString("<="); WriteLn;
  372.     END;
  373.     ...
  374.  
  375.    NOTES
  376.     Its is better only to use this function for years from -7 to 3200!
  377.  
  378.    BUGS
  379.     No known bugs.
  380.  
  381.    SEE ALSO
  382.     JulianDayGreater(),HeisDayGreater()
  383.  
  384. Date/GregorianDaysAfterWeekday                 Date/GregorianDaysAfterWeekday
  385.  
  386.    NAME
  387.     GregorianDaysAfterWeekday -- Returns the diff to wday after. (V33)
  388.  
  389.    SYNOPSIS
  390.     days := GregorianDaysAfterWeekday(day,month,year,weekday);
  391.  
  392.     PROCEDURE GregorianDaysAfterWeekday(day,month : SHORTINT;
  393.         year : INTEGER; weekday : Weekdays) : SHORTINT;
  394.  
  395.    FUNCTION
  396.     Returns the days to the weekday after the specified date.
  397.     So if you specifie the 22.1.1994 (saturday) and thursday
  398.     you get back 5!
  399.     If you specifie the 22.1.1994 and saturday you became back 0
  400.     (the same day)!
  401.  
  402.    INPUTS
  403.     day     - day of the date
  404.     month   - month of the date
  405.     year    - year of the date
  406.     weekday - weekday to search for building difference
  407.  
  408.    RESULT
  409.     days - The days after to the searched weekday.
  410.  
  411.    EXAMPLE
  412.     ...
  413.     days := GregorianDaysAfterWeekday(22,1,1994,thursday);
  414.     ...
  415.  
  416.    NOTES
  417.     Its better to use this fkt only from -7 to 3200!
  418.  
  419.    BUGS
  420.     See GregorianWeekday()!
  421.  
  422.    SEE ALSO
  423.     JulianDaysAfterWeekday(),HeisDaysAfterWeekday(),GregorianWeekday()
  424.  
  425. Date/GregorianDaysBeforeWeekday               Date/GregorianDaysBeforeWeekday
  426.  
  427.    NAME
  428.     GregorianDaysBeforeWeekday -- Returns the diff to wday before. (V33)
  429.  
  430.    SYNOPSIS
  431.     days := GregorianDaysBeforeWeekday(day,month,year,weekday);
  432.  
  433.     PROCEDURE GregorianDaysBeforeWeekday(day,month : SHORTINT;
  434.         year : INTEGER; weekday : Weekdays) : SHORTINT;
  435.  
  436.    FUNCTION
  437.     Returns the days to the weekday before the specified date.
  438.     So if you specifie the 22.1.1994 (saturday) and thursday
  439.     you get back 2!
  440.     If you specifie the 22.1.1994 and saturday you became back 0
  441.     (the same day)!
  442.  
  443.    INPUTS
  444.     day     - day of the date
  445.     month   - month of the date
  446.     year    - year of the date
  447.     weekday - weekday to search for building difference
  448.  
  449.    RESULT
  450.     days - The days back to the searched weekday (1-7)
  451.         If you get back 8 an error occurs!
  452.  
  453.    EXAMPLE
  454.     ...
  455.     days := GregorianDaysBeforeWeekday(22,1,1994,thursday);
  456.     ...
  457.  
  458.    NOTES
  459.     Its better to use this fkt only from -7 to 3200!
  460.  
  461.    BUGS
  462.     See GregorianWeekday()!
  463.  
  464.    SEE ALSO
  465.     JulianDaysBeforeWeekday(),HeisDaysBeforeWekday(),GregorianWeekday()
  466.  
  467. Date/GregorianDaySmaller                             Date/GregorianDaySmaller
  468.  
  469.    NAME
  470.     GregorianDaySmaller -- Checks if date1 is smaller than date2. (V33)
  471.  
  472.    SYNOPSIS
  473.     smaller := GregorianDaySmaller(day1,month1,year1,day2,month2,year2);
  474.  
  475.     PROCEDURE GregorianDaySmaller(day1,month1 : SHORTINT;
  476.         year1 : INTEGER; day2,month2 : SHORTINT;
  477.         year2 : INTEGER) : BOOLEAN;
  478.  
  479.    FUNCTION
  480.     GregorianDaySmaller test if date1 is smaller than date2.
  481.  
  482.    INPUTS
  483.     day1   - day of the first date
  484.     month1 - month of the first date
  485.     year1  - year of the first date
  486.     day2   - day of the second date
  487.     month2 - month of the second month
  488.     year2  - year of the second date
  489.  
  490.    RESULT
  491.     smaller - This is TRUE is date1 < date2 otherwise it's FALSE.
  492.  
  493.    EXAMPLE
  494.     ...
  495.     IF GregorianDaySmaller(18,9,1970,22,1,1994) THEN
  496.       WriteString("<"); WriteLn;
  497.     ELSE
  498.       WriteString(">="); WriteLn;
  499.     END;
  500.     ...
  501.  
  502.    NOTES
  503.     Its is better only to use this function for years from -7 to 3200!
  504.  
  505.    BUGS
  506.     No known bugs.
  507.  
  508.    SEE ALSO
  509.     JulianDaySmaller(),HeisDaySmaller()
  510.  
  511. Date/GregorianDiffDate                                 Date/GregorianDiffDate
  512.  
  513.    NAME
  514.     GregorianDiffDate -- Returns the diff date to another date. (V33)
  515.  
  516.    SYNOPSIS
  517.     GregorianDiffDate(day,month,year,diffdays,dday,dmonth,dyear);
  518.  
  519.     PROCEDURE GregorianDiffDate(day,month : SHORTINT;
  520.         year,days : INTEGER; VAR dday,dmonth : SHORTINT;
  521.         VAR dyear : INTEGER);
  522.  
  523.    FUNCTION
  524.     Returns the date wich lies diffdays before/after the specified date.
  525.  
  526.    INPUTS
  527.     day      - day of the date
  528.     month    - month of the date
  529.     year     - year of the date
  530.     diffdays - difference to the date in days
  531.  
  532.    RESULT
  533.     dday   - Destination day
  534.     dmonth - Destination month
  535.     dyear  - Destination year
  536.  
  537.    EXAMPLE
  538.     ...
  539.     GregorianDiffDate(23,1,1994,7,dday,dmonth,dyear);
  540.     ...
  541.  
  542.    NOTES
  543.     Its better to use this fkt only from -7 to 3200!
  544.  
  545.    BUGS
  546.     unknown.
  547.  
  548.    SEE ALSO
  549.     JulianDiffDate(),HeisDiffDate(),GregoriandayDiff(),
  550.     GregorianMonthDays()
  551.  
  552. Date/GregorianEaster                                     Date/GregorianEaster
  553.  
  554.    NAME
  555.     GregorianEaster -- Returns the date of eastern in a year (V33)
  556.  
  557.    SYNOPSIS
  558.     GregorianEaster(year,dday,dmonth);
  559.  
  560.     PROCEDURE GregorianEaster(year : INTEGER;
  561.         VAR dday,dmonth : SHORTINT);
  562.  
  563.    FUNCTION
  564.     Returns the date of eastern for a specified year.
  565.  
  566.    INPUTS
  567.     year  - eastern is calculated for this year
  568.  
  569.    RESULT
  570.     dday   - day of easter-sunday
  571.     dmonth - month of easter-sunday
  572.  
  573.    EXAMPLE
  574.     ...
  575.     GregorianEaster(1994,dday,dmonth);
  576.     ...
  577.  
  578.    NOTES
  579.     Use this only for 1582 to 4100!
  580.     This is only a experimental version!
  581.  
  582.    BUGS
  583.     In some years eastern lies one week behind!
  584.  
  585.    SEE ALSO
  586.     GregorianMoonAge(),GregorianDaysAfterWeekday()
  587.  
  588. Date/GregorianLeapYear                                 Date/GregorianLeapYear
  589.  
  590.    NAME
  591.     GregorianLeapYear -- Checks if a year is a leap year. (V33)
  592.  
  593.    SYNOPSIS
  594.     leapyear := GregorianLeapYear(year);
  595.  
  596.     PROCEDURE GregorianLeapYear(year : INTEGER) : BOOLEAN;
  597.  
  598.    FUNCTION
  599.     GregorianLeapYear checks if a year is a leap year.
  600.     For years after 1582 all years dividable by 4 are leap years,
  601.     without years dividable by 100, but years dividable by 400
  602.     are leap years again!
  603.     For years before 1582 see JulianLeapYear().
  604.  
  605.    INPUTS
  606.     year - The year which should be checked (from -32768 to 32767)
  607.         I think only values from -7 to 3200 are valid, because of
  608.         the variant that was done on -8 by Augustus!
  609.  
  610.    RESULT
  611.     leapyear - TRUE if the year is a leap year, otherwise false.
  612.  
  613.    EXAMPLE
  614.     ...
  615.     IF GregorianLeapYear(1994) THEN
  616.       WriteString("leap year!");
  617.     ELSE
  618.       WriteString("no leap year!");
  619.     END;
  620.     WriteLn;
  621.     ...
  622.  
  623.    NOTES
  624.     A year is 365.2425 days long!
  625.     Use this function only for values from -7 to 3200!
  626.  
  627.    BUGS
  628.     No known bugs.
  629.  
  630.    SEE ALSO
  631.     JulianLeapYear(),HeisLeapYear()
  632.  
  633. Date/GregorianMonthDays                               Date/GregorianMonthDays
  634.  
  635.    NAME
  636.     GregorianMonthDays -- Gives back the number of days of a month. (V33)
  637.  
  638.    SYNOPSIS
  639.     days := GregorianMonthDays(month,year);
  640.  
  641.     PROCEDURE GregorianMonthDays(month : SHORTINT;
  642.         year : INTEGER) : SHORTINT;
  643.  
  644.    FUNCTION
  645.     GregorianMonthDays gives you back the number of days a month in
  646.     a specified year have.
  647.     For the year 1582 and the month 10 there are only 21 days,
  648.     because of the Gregorian-reform 10 days are delete from
  649.     the month (for more look out for books about this!)
  650.  
  651.    INPUTS
  652.     month - The month from wich you want to get the number of days.
  653.     year  - The year in which the month is.
  654.  
  655.    RESULT
  656.     days - The number of days the month uses, or 0 if you use
  657.         a wrong month.
  658.  
  659.    EXAMPLE
  660.     ...
  661.     days := GregorianMonthDays(1,1994);
  662.     WriteString("Days of January 1994 : ");
  663.     WriteCard(days,2); WriteLn;
  664.     ...
  665.  
  666.    NOTES
  667.     Use this function only for years from -7 to 3200!
  668.  
  669.    BUGS
  670.     If the reform in a country is not in the same month an error will
  671.     occur!
  672.  
  673.    SEE ALSO
  674.     GregorianLeapYear(),JulianMonthDays(),HeisMonthDays()
  675.  
  676. Date/GregorianMoonAge                                   Date/GregorianMoonAge
  677.  
  678.    NAME
  679.     GregorianMoonAge -- Returns the age of the moon (V33)
  680.  
  681.    SYNOPSIS
  682.     ep := GregorianMoonAge(day,month,year);
  683.  
  684.     PROCEDURE GregorianMoonAge(day,month : SHORTINT;
  685.         year : INTEGER) : SHORTINT;
  686.  
  687.    FUNCTION
  688.     Returns the age of the moon on a specified date.
  689.  
  690.    INPUTS
  691.     day   - For this day the age is calculated.
  692.     month - For this month the age is calculated.
  693.     year  - For this year the age is calculated.
  694.  
  695.    RESULT
  696.     ep - The age of the moon on the specified date.
  697.  
  698.    EXAMPLE
  699.     ...
  700.     ep := GregorianMoonAge(18,9,1994);
  701.     ...
  702.  
  703.    NOTES
  704.     Use this only for 1582 to 4100!
  705.     This is only a experimental version!
  706.  
  707.    BUGS
  708.     unknown.
  709.  
  710.    SEE ALSO
  711.     MoonMonthAge(),GregorianEP()
  712.  
  713. Date/GregorianToJD                                         Date/GregorianToJD
  714.  
  715.    NAME
  716.     GregorianToJD -- Returns the JD for a date. (V33)
  717.  
  718.    SYNOPSIS
  719.     jd := GregorianToJD(day,month,year);
  720.  
  721.     PROCEDURE GregorianToJD(day,month : SHORTINT;
  722.         year : INTEGER) : LONGINT;
  723.  
  724.    FUNCTION
  725.     Returns the JD for a Gregorian date.
  726.  
  727.    INPUTS
  728.     day      - day of the date to convert
  729.     month    - month of the date to convert
  730.     year     - year of the date to convert
  731.  
  732.    RESULT
  733.     jd - This is the JD
  734.  
  735.    EXAMPLE
  736.     ...
  737.     jd := GregorianToJD(23,1,1994);
  738.     ...
  739.  
  740.    NOTES
  741.     Its better to use this fkt only from -7 to 3200!
  742.  
  743.    BUGS
  744.     unknown.
  745.  
  746.    SEE ALSO
  747.     JulianToJD(),HeisToJD(),GSYearToJD(),GYearToScaliger(),
  748.     GregorianDayDiff()
  749.  
  750. Date/GregorianWeek                                         Date/GregorianWeek
  751.  
  752.    NAME
  753.     GregorianWeek -- Gets the weeknumber of a specified date. (V33)
  754.  
  755.    SYNOPSIS
  756.     weeknr := GregorianWeek(day,month,year);
  757.  
  758.     PROCEDURE GregorianWeek(day,month : SHORTINT;
  759.         year : INTEGER) : SHORTINT;
  760.  
  761.    FUNCTION
  762.     GregorianWeek gets the weeknumber for a specified date.
  763.  
  764.    INPUTS
  765.     day   - day of the date
  766.     month - month of the date
  767.     year  - year of the date
  768.  
  769.    RESULT
  770.     week - This is the number of the week the specified date lies in.
  771.         If the first day in a new year is a freiday, saturday or
  772.         sunday, this would be the last week of the last year!
  773.         If the 29.12. is a monday, the 30.12. is a monday or a tuesday,
  774.         the 31.12. is a monday, tuesday or a wednesday this is the
  775.         first week of the next year!
  776.  
  777.    EXAMPLE
  778.     ...
  779.     weeknr := GregorianWeek(4,10,1582);
  780.     ...
  781.  
  782.    NOTES
  783.     Its is better only to use this function for years from 0 to 3000!
  784.  
  785.    BUGS
  786.     For years < 0 errors could occur.
  787.  
  788.    SEE ALSO
  789.     JulianWeek(),HeisWeek(),GregorianWeekday(),GregorianDayDiff(),
  790.     GregorianDaySmaller()
  791.  
  792. Date/GregorianWeekday                                   Date/GregorianWeekday
  793.  
  794.    NAME
  795.     GregorianWeekday -- Gets the weekday of a specified date. (V33)
  796.  
  797.    SYNOPSIS
  798.     weekday := GregorianWeekday(day,month,year);
  799.  
  800.     PROCEDURE GregorianWeekday(day,month : SHORTINT;
  801.         year : INTEGER) : Weekday;
  802.  
  803.    FUNCTION
  804.     GregorianWeekday gets the weekday for a specified date.
  805.  
  806.    INPUTS
  807.     day   - day of the date
  808.     month - month of the date
  809.     year  - year of the date
  810.  
  811.    RESULT
  812.     weekday - This result is of type:
  813.         Weekdays = (dayerr,monday,tuesday,wednesday,thursday,freiday,
  814.         saturday,sunday);
  815.         dayerr will show you, that an error occurs!
  816.  
  817.    EXAMPLE
  818.     ...
  819.     weekday := GregorianWeekday(22,1,1994);
  820.     IF weekday = dayerr THEN
  821.     ...
  822.     END;
  823.     ...
  824.  
  825.    NOTES
  826.     Its is better only to use this function for years from -7 to 3200!
  827.     In this version dayerr will only occur for the lost days :)
  828.  
  829.    BUGS
  830.     It's not possible to use years < 0 (for more see JulianWeekday()).
  831.  
  832.    SEE ALSO
  833.     JulianWeekday(),HeisWeekday(),GregorianDaySmaller(),
  834.     GregorianLeapYear()
  835.  
  836. Date/GregorianYearDays                                 Date/GregorianYearDays
  837.  
  838.    NAME
  839.     GregorianYearDays -- Gives back the number of days in a year. (V33)
  840.  
  841.    SYNOPSIS
  842.     days := GregorianYearDays(year);
  843.  
  844.     PROCEDURE GregorianYearDays(year : INTEGER) : INTEGER;
  845.  
  846.    FUNCTION
  847.     GregorianYearDays gives you back the number of days in
  848.     a specified year.
  849.  
  850.    INPUTS
  851.     year  - The year in which to count the days.
  852.         (I think its better not to use years before -7!)
  853.  
  854.    RESULT
  855.     days - The number of days the year uses.
  856.  
  857.    EXAMPLE
  858.     ...
  859.     days := GregorianYearDays(1994);
  860.     WriteString("Days of 1994 : ");
  861.     WriteCard(days,3); WriteLn;
  862.     ...
  863.  
  864.    NOTES
  865.     Its is better only to use this function for years from -7 to 3200!
  866.  
  867.    BUGS
  868.     No known bugs.
  869.  
  870.    SEE ALSO
  871.     GregorianMonthDays(),JulianYearDays(),HeisYearDays()
  872.  
  873. Date/GSYearToJD                                               Date/GSYearToJD
  874.  
  875.    NAME
  876.     GSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  877.  
  878.    SYNOPSIS
  879.     jd := GSYearToJD(syear);
  880.  
  881.     PROCEDURE GSYearToJD(syear : INTEGER) : LONGINT;
  882.  
  883.    FUNCTION
  884.     Returns the Julianday of a Scaliger year.
  885.  
  886.    INPUTS
  887.     syear     - Scaliger year
  888.  
  889.    RESULT
  890.     jd - The Julianday
  891.  
  892.    EXAMPLE
  893.     ...
  894.     jd := GSYearToJD(4800);
  895.     ...
  896.  
  897.    NOTES
  898.     Its better to use this fkt only from 4707 to 7981!
  899.  
  900.    BUGS
  901.     unknown.
  902.  
  903.    SEE ALSO
  904.     JSYearToJD(),HSYearToJD()
  905.  
  906. Date/GYearToScaliger                                     Date/GYearToScaliger
  907.  
  908.    NAME
  909.     GYearToScaliger -- Returns the year as Scaliger year. (V33)
  910.  
  911.    SYNOPSIS
  912.     syear := GYearToScaliger(year);
  913.  
  914.     PROCEDURE GYearToScaliger(year : INTEGER) : INTEGER;
  915.  
  916.    FUNCTION
  917.     Returns the Scaliger year.
  918.  
  919.    INPUTS
  920.     year     - Gregorian year
  921.  
  922.    RESULT
  923.     syear - The Scaliger year
  924.  
  925.    EXAMPLE
  926.     ...
  927.     syear := GYearToScaliger(1994);
  928.     ...
  929.  
  930.    NOTES
  931.     Its better to use this fkt only from -7 to 3200!
  932.  
  933.    BUGS
  934.     unknown.
  935.  
  936.    SEE ALSO
  937.     JYearToScaliger(),HYearToScaliger()
  938.  
  939. Date/HeisDayDiff                                             Date/HeisDayDiff
  940.  
  941.    NAME
  942.     HeisDayDiff -- Calculates the days between 2 dates. (V33)
  943.  
  944.    SYNOPSIS
  945.     days := HeisDayDiff(day1,month1,year1,day2,month2,year2);
  946.  
  947.     PROCEDURE HeisDayDiff(day1,month1 : SHORTINT; year1 : INTEGER;
  948.         day2,month2 : SHORTINT; year2 : INTEGER) : LONGINT;
  949.  
  950.    FUNCTION
  951.     HeisDayDiff gives you back the number of days between
  952.     two specified dates.
  953.  
  954.    INPUTS
  955.     day1   - day of the first date
  956.     month1 - month of the first date
  957.     year1  - year of the first date
  958.     day2   - day of the second date
  959.     month2 - month of the second month
  960.     year2  - year of the second date
  961.  
  962.    RESULT
  963.     days - The number of days between the two dates
  964.         (positive if date1 <= date2).
  965.  
  966.    EXAMPLE
  967.     ...
  968.     days := HeisDayDiff(18,9,1970,22,1,1994);
  969.     WriteString("Age of Kai Hofmann in days : ");
  970.     WriteInt(days,10); WriteLn;
  971.     ...
  972.  
  973.    NOTES
  974.     Its is better only to use this function for years from -7 to 8000!
  975.  
  976.    BUGS
  977.     If you use on of the dates 5.10.1582 to 14.10.1582 you will become
  978.     wrong output, because this days don't exist!
  979.  
  980.    SEE ALSO
  981.     JulianDayDiff(),GregorianDayDiff(),HeisDaySmaller(),HeisDayGreater(),
  982.     HeisMonthDays(),HeisYearDays()
  983.  
  984. Date/HeisDayGreater                                       Date/HeisDayGreater
  985.  
  986.    NAME
  987.     HeisDayGreater -- Checks if date1 is greater than date2. (V33)
  988.  
  989.    SYNOPSIS
  990.     greater := HeisDayGreater(day1,month1,year1,day2,month2,year2);
  991.  
  992.     PROCEDURE HeisDayGreater(day1,month1 : SHORTINT; year1 : INTEGER;
  993.         day2,month2 : SHORTINT; year2 : INTEGER) : BOOLEAN;
  994.  
  995.    FUNCTION
  996.     HeisDayGreater test if date1 is great than date2.
  997.  
  998.    INPUTS
  999.     day1   - day of the first date
  1000.     month1 - month of the first date
  1001.     year1  - year of the first date
  1002.     day2   - day of the second date
  1003.     month2 - month of the second month
  1004.     year2  - year of the second date
  1005.  
  1006.    RESULT
  1007.     greater - This is TRUE is date1 > date2 otherwise it's FALSE.
  1008.  
  1009.    EXAMPLE
  1010.     ...
  1011.     IF HeisDaySmaller(18,9,1970,22,1,1994) THEN
  1012.       WriteString(">"); WriteLn;
  1013.     ELSE
  1014.       WriteString("<="); WriteLn;
  1015.     END;
  1016.     ...
  1017.  
  1018.    NOTES
  1019.     Its is better only to use this function for years from -7 to 8000!
  1020.  
  1021.    BUGS
  1022.     No known bugs.
  1023.  
  1024.    SEE ALSO
  1025.     JulianDayGreater(),GregorianDayGreater()
  1026.  
  1027. Date/HeisDaysAfterWeekday                           Date/HeisDaysAfterWeekday
  1028.  
  1029.    NAME
  1030.     HeisDaysAfterWeekday -- Returns the diff to the wday after. (V33)
  1031.  
  1032.    SYNOPSIS
  1033.     days := HeisDaysAfterWeekday(day,month,year,weekday);
  1034.  
  1035.     PROCEDURE HeisDaysAfterWeekday(day,month : SHORTINT;
  1036.         year : INTEGER; weekday : Weekdays) : SHORTINT;
  1037.  
  1038.    FUNCTION
  1039.     Returns the days to the weekday after the specified date.
  1040.     So if you specifie the 22.1.1994 (saturday) and thursday
  1041.     you get back 5!
  1042.     If you specifie the 22.1.1994 and saturday you became back 0
  1043.     (the same day)!
  1044.  
  1045.    INPUTS
  1046.     day     - day of the date
  1047.     month   - month of the date
  1048.     year    - year of the date
  1049.     weekday - weekday to search for building difference
  1050.  
  1051.    RESULT
  1052.     days - The days after to the searched weekday.
  1053.  
  1054.    EXAMPLE
  1055.     ...
  1056.     days := HeisDaysAfterWeekday(22,1,1994,thursday);
  1057.     ...
  1058.  
  1059.    NOTES
  1060.     Its better to use this fkt only from -7 to 8000!
  1061.  
  1062.    BUGS
  1063.     See HeisWeekday()!
  1064.  
  1065.    SEE ALSO
  1066.     JulianDaysAfterWeekday(),GregorianDaysAfterWeekday(),HeisWeekday()
  1067.  
  1068. Date/HeisDaysBeforeWeekday                         Date/HeisDaysBeforeWeekday
  1069.  
  1070.    NAME
  1071.     HeisDaysBeforeWeekday -- Returns the diff to wday before. (V33)
  1072.  
  1073.    SYNOPSIS
  1074.     days := HeisDaysBeforeWeekday(day,month,year,weekday);
  1075.  
  1076.     PROCEDURE HeisDaysBeforeWeekday(day,month : SHORTINT;
  1077.         year : INTEGER; weekday : Weekdays) : SHORTINT;
  1078.  
  1079.    FUNCTION
  1080.     Returns the days to the weekday before the specified date.
  1081.     So if you specifie the 22.1.1994 (saturday) and thursday
  1082.     you get back 2!
  1083.     If you specifie the 22.1.1994 and saturday you became back 0
  1084.     (the same day)!
  1085.  
  1086.    INPUTS
  1087.     day     - day of the date
  1088.     month   - month of the date
  1089.     year    - year of the date
  1090.     weekday - weekday to search for building difference
  1091.  
  1092.    RESULT
  1093.     days - The days back to the searched weekday (1-7)
  1094.         If you get back 8 an error occurs!
  1095.  
  1096.    EXAMPLE
  1097.     ...
  1098.     days := HeisDaysBeforeWeekday(22,1,1994,thursday);
  1099.     ...
  1100.  
  1101.    NOTES
  1102.     Its better to use this fkt only from -7 to 8000!
  1103.  
  1104.    BUGS
  1105.     See HeisWeekday()!
  1106.  
  1107.    SEE ALSO
  1108.     JulianDaysBeforeWeekday(),GregorianDaysBeforeWeekday(),HeisWeekday()
  1109.  
  1110. Date/HeisDaySmaller                                       Date/HeisDaySmaller
  1111.  
  1112.    NAME
  1113.     HeisDaySmaller -- Checks if date1 is smaller than date2. (V33)
  1114.  
  1115.    SYNOPSIS
  1116.     smaller := HeisDaySmaller(day1,month1,year1,day2,month2,year2);
  1117.  
  1118.     PROCEDURE HeisDaySmaller(day1,month1 : SHORTINT; year1 : INTEGER;
  1119.         day2,month2 : SHORTINT; year2 : INTEGER) : BOOLEAN;
  1120.  
  1121.    FUNCTION
  1122.     HeisDaySmaller test if date1 is smaller than date2.
  1123.  
  1124.    INPUTS
  1125.     day1   - day of the first date
  1126.     month1 - month of the first date
  1127.     year1  - year of the first date
  1128.     day2   - day of the second date
  1129.     month2 - month of the second month
  1130.     year2  - year of the second date
  1131.  
  1132.    RESULT
  1133.     smaller - This is TRUE is date1 < date2 otherwise it's FALSE.
  1134.  
  1135.    EXAMPLE
  1136.     ...
  1137.     IF HeisDaySmaller(18,9,1970,22,1,1994) THEN
  1138.       WriteString("<"); WriteLn;
  1139.     ELSE
  1140.       WriteString(">="); WriteLn;
  1141.     END;
  1142.     ...
  1143.  
  1144.    NOTES
  1145.     Its is better only to use this function for years from -7 to 8000!
  1146.  
  1147.    BUGS
  1148.     No known bugs.
  1149.  
  1150.    SEE ALSO
  1151.     JulianDaySmaller(),GregorianDaySmaller()
  1152.  
  1153. Date/HeisDiffDate                                           Date/HeisDiffDate
  1154.  
  1155.    NAME
  1156.     HeisDiffDate -- Returns the date for a diff to another date. (V33)
  1157.  
  1158.    SYNOPSIS
  1159.     HeisDiffDate(day,month,year,diffdays,dday,dmonth,dyear);
  1160.  
  1161.     PROCEDURE HeisDiffDate(day,month : SHORTINT; year,days : INTEGER;
  1162.          VAR dday,dmonth : SHORTINT; VAR dyear : INTEGER);
  1163.  
  1164.    FUNCTION
  1165.     Returns the date wich lies diffdays before/after the specified date.
  1166.  
  1167.    INPUTS
  1168.     day      - day of the date
  1169.     month    - month of the date
  1170.     year     - year of the date
  1171.     diffdays - difference to the date in days
  1172.  
  1173.    RESULT
  1174.     dday   - Destination day
  1175.     dmonth - Destination month
  1176.     dyear  - Destination year
  1177.  
  1178.    EXAMPLE
  1179.     ...
  1180.     HeisDiffDate(23,1,1994,7,dday,dmonth,dyear);
  1181.     ...
  1182.  
  1183.    NOTES
  1184.     Its better to use this fkt only from -7 to 8000!
  1185.  
  1186.    BUGS
  1187.     unknown.
  1188.  
  1189.    SEE ALSO
  1190.     JuliandiffDate(),GregorianDiffdate(),HeisDayDiff(),HeisMonthDays()
  1191.  
  1192. Date/HeisLeapYear                                           Date/HeisLeapYear
  1193.  
  1194.    NAME
  1195.     HeisLeapYear -- Checks if a year is a leap year. (V33)
  1196.  
  1197.    SYNOPSIS
  1198.     leapyear := HeisLeapYear(year);
  1199.  
  1200.     PROCEDURE HeisLeapYear(year : INTEGER) : BOOLEAN;
  1201.  
  1202.    FUNCTION
  1203.     HeisLeapYear checks if a year is a leap year.
  1204.     For years after 1582 see GregorianLeapYear(),
  1205.     The correction from N. Heis says, that all years dividable by
  1206.     3200 are no longer leap years!
  1207.     For years before 1582 see JulianLeapYear
  1208.  
  1209.    INPUTS
  1210.     year - The year which should be checked (from -32768 to 32767)
  1211.         I think only values from -7 to 8000 are valid, because of
  1212.         the variant that was done on -8 by Augustus!
  1213.  
  1214.    RESULT
  1215.     leapyear - TRUE if the year is a leap year, otherwise false.
  1216.  
  1217.    EXAMPLE
  1218.     ...
  1219.     IF HeisLeapYear(1994) THEN
  1220.       WriteString("leap year!");
  1221.     ELSE
  1222.       WriteString("no leap year!");
  1223.     END;
  1224.     WriteLn;
  1225.     ...
  1226.  
  1227.    NOTES
  1228.     A year is now 365.2421875 days!
  1229.     Use this function only for values from -7 to 8000!
  1230.  
  1231.    BUGS
  1232.     No known bugs.
  1233.  
  1234.    SEE ALSO
  1235.     JulianLeapYear(),GregorianLeapYear()
  1236.  
  1237. Date/HeisMonthDays                                         Date/HeisMonthDays
  1238.  
  1239.    NAME
  1240.     HeisMonthDays -- Gives back the number of days of a month. (V33)
  1241.  
  1242.    SYNOPSIS
  1243.     days := HeisMonthDays(month,year);
  1244.  
  1245.     PROCEDURE HeisMonthDays(month : SHORTINT;
  1246.         year : INTEGER) : SHORTINT;
  1247.  
  1248.    FUNCTION
  1249.     HeisMonthDays gives you back the number of days a month in
  1250.     a specified year have.
  1251.     For the year 1582 and the month 10 there are only 21 days,
  1252.     because of the Gregorian-reform 10 days are delete from
  1253.     the month (for more look out for books about this!)
  1254.  
  1255.    INPUTS
  1256.     month - The month from wich you want to get the number of days.
  1257.     year  - The year in which the month is.
  1258.  
  1259.    RESULT
  1260.     days - The number of days the month uses, or 0 if you use
  1261.         a wrong month.
  1262.  
  1263.    EXAMPLE
  1264.     ...
  1265.     days := HeisMonthDays(1,1994);
  1266.     WriteString("Days of January 1994 : ");
  1267.     WriteCard(days,2); WriteLn;
  1268.     ...
  1269.  
  1270.    NOTES
  1271.     Use this function only for years from -7 to 8000!
  1272.  
  1273.    BUGS
  1274.     See GregorianMonthDays!
  1275.  
  1276.    SEE ALSO
  1277.     HeisLeapYear(),JulianMonthDays(),GregorianMonthDays()
  1278.  
  1279. Date/HeisToJD                                                   Date/HeisToJD
  1280.  
  1281.    NAME
  1282.     HeisToJD -- Returns the JD for a date. (V33)
  1283.  
  1284.    SYNOPSIS
  1285.     jd := HeisToJD(day,month,year);
  1286.  
  1287.     PROCEDURE HeisToJD(day,month : SHORTINT;
  1288.         year : INTEGER) : LONGINT;
  1289.  
  1290.    FUNCTION
  1291.     Returns the JD for a Heis date.
  1292.  
  1293.    INPUTS
  1294.     day      - day of the date to convert
  1295.     month    - month of the date to convert
  1296.     year     - year of the date to convert
  1297.  
  1298.    RESULT
  1299.     jd - This is the JD
  1300.  
  1301.    EXAMPLE
  1302.     ...
  1303.     jd := HeisToJD(23,1,1994);
  1304.     ...
  1305.  
  1306.    NOTES
  1307.     Its better to use this fkt only from -7 to 3268!
  1308.  
  1309.    BUGS
  1310.     unknown.
  1311.  
  1312.    SEE ALSO
  1313.     JulianToJD(),GregorianToJD(),HSYearToJD(),HYearToScaliger(),
  1314.     HeisDayDiff()
  1315.  
  1316. Date/HeisWeek                                                   Date/HeisWeek
  1317.  
  1318.    NAME
  1319.     HeisWeek -- Gets the weeknumber of a specified date. (V33)
  1320.  
  1321.    SYNOPSIS
  1322.     weeknr := HeisWeek(day,month,year);
  1323.  
  1324.     PROCEDURE HeisWeek(day,month : SHORTINT;
  1325.         year : INTEGER) : SHORTINT;
  1326.  
  1327.    FUNCTION
  1328.     HeisWeek gets the weeknumber for a specified date.
  1329.  
  1330.    INPUTS
  1331.     day   - day of the date
  1332.     month - month of the date
  1333.     year  - year of the date
  1334.  
  1335.    RESULT
  1336.     week - This is the number of the week the specified date lies in.
  1337.         If the first day in a new year is a freiday, saturday or
  1338.         sunday, this would be the last week of the last year!
  1339.         If the 29.12. is a monday, the 30.12. is a monday or a tuesday,
  1340.         the 31.12. is a monday, tuesday or a wednesday this is the
  1341.         first week of the next year!
  1342.  
  1343.    EXAMPLE
  1344.     ...
  1345.     weeknr := HeisWeek(4,10,1582);
  1346.     ...
  1347.  
  1348.    NOTES
  1349.     Its is better only to use this function for years from 0 to 8000!
  1350.  
  1351.    BUGS
  1352.     For years < 0 errors could occur.
  1353.  
  1354.    SEE ALSO
  1355.     JulianWeek(),GregorianWeek(),HeisWeekday(),HeisDayDiff(),
  1356.     HeisDaySmaller()
  1357.  
  1358. Date/HeisWeekday                                             Date/HeisWeekday
  1359.  
  1360.    NAME
  1361.     HeisWeekday -- Gets the weekday of a specified date. (V33)
  1362.  
  1363.    SYNOPSIS
  1364.     weekday := HeisWeekday(day,month,year);
  1365.  
  1366.     PROCEDURE HeisWeekday(day,month : SHORTINT;
  1367.         year : INTEGER) : Weekday;
  1368.  
  1369.    FUNCTION
  1370.     HeisWeekday gets the weekday for a specified date.
  1371.  
  1372.    INPUTS
  1373.     day   - day of the date
  1374.     month - month of the date
  1375.     year  - year of the date
  1376.  
  1377.    RESULT
  1378.     weekday - This result is of type:
  1379.         Weekdays = (dayerr,monday,tuesday,wednesday,thursday,freiday,
  1380.         saturday,sunday);
  1381.         dayerr will show you, that an error occurs!
  1382.  
  1383.    EXAMPLE
  1384.     ...
  1385.     weekday := HeisWeekday(22,1,1994);
  1386.     IF weekday = dayerr THEN
  1387.     ...
  1388.     END;
  1389.     ...
  1390.  
  1391.    NOTES
  1392.     Its is better only to use this function for years from -7 to 8000!
  1393.     In this version dayerr will only occur for the lost days :)
  1394.  
  1395.    BUGS
  1396.     Its not possible to use year < 0 (see JulianWeekday() for more).
  1397.  
  1398.    SEE ALSO
  1399.     JulianWeekday(),GregorianWeekday(),HeisDaySmaller(),HeisLeapYear()
  1400.  
  1401. Date/HeisYearDays                                           Date/HeisYearDays
  1402.  
  1403.    NAME
  1404.     HeisYearDays -- Gives back the number of days in a year. (V33)
  1405.  
  1406.    SYNOPSIS
  1407.     days := HeisYearDays(year);
  1408.  
  1409.     PROCEDURE HeisYearDays(year : INTEGER) : INTEGER;
  1410.  
  1411.    FUNCTION
  1412.     HeisYearDays gives you back the number of days in
  1413.     a specified year.
  1414.  
  1415.    INPUTS
  1416.     year  - The year in which to count the days.
  1417.         (I think its better not to use years before -7!)
  1418.  
  1419.    RESULT
  1420.     days - The number of days the year uses.
  1421.  
  1422.    EXAMPLE
  1423.     ...
  1424.     days := HeisYearDays(1994);
  1425.     WriteString("Days of 1994 : ");
  1426.     WriteCard(days,3); WriteLn;
  1427.     ...
  1428.  
  1429.    NOTES
  1430.     Its is better only to use this function for years from -7 to 8000!
  1431.  
  1432.    BUGS
  1433.     No known bugs.
  1434.  
  1435.    SEE ALSO
  1436.     HeisMonthDays(),JulianYearDays(),GregorianYearDays()
  1437.  
  1438. Date/HSYearToJD                                               Date/HSYearToJD
  1439.  
  1440.    NAME
  1441.     HSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  1442.  
  1443.    SYNOPSIS
  1444.     jd := HSYearToJD(syear);
  1445.  
  1446.     PROCEDURE HSYearToJD(syear : INTEGER) : LONGINT;
  1447.  
  1448.    FUNCTION
  1449.     Returns the Julianday of a Scaliger year.
  1450.  
  1451.    INPUTS
  1452.     syear     - Scaliger year
  1453.  
  1454.    RESULT
  1455.     jd - The Julianday
  1456.  
  1457.    EXAMPLE
  1458.     ...
  1459.     jd := HSYearToJD(6700);
  1460.     ...
  1461.  
  1462.    NOTES
  1463.     Its better to use this fkt only from 4707 to 7981!
  1464.     In this version only GSYearToJD() is called, because the
  1465.     Scaliger period is only valid to 3268
  1466.  
  1467.    BUGS
  1468.     unknown.
  1469.  
  1470.    SEE ALSO
  1471.     JSYearToJD(),GSYearToJD()
  1472.  
  1473. Date/HYearToScaliger                                     Date/HYearToScaliger
  1474.  
  1475.    NAME
  1476.     HYearToScaliger -- Returns the year as Scaliger year. (V33)
  1477.  
  1478.    SYNOPSIS
  1479.     syear := HYearToScaliger(year);
  1480.  
  1481.     PROCEDURE HYearToScaliger(year : INTEGER) : INTEGER;
  1482.  
  1483.    FUNCTION
  1484.     Returns the Scaliger year.
  1485.  
  1486.    INPUTS
  1487.     year     - Heis year
  1488.  
  1489.    RESULT
  1490.     syear - The Scaliger year
  1491.  
  1492.    EXAMPLE
  1493.     ...
  1494.     syear := HYearToScaliger(1994);
  1495.     ...
  1496.  
  1497.    NOTES
  1498.     Its better to use this fkt only from -7 to 8000!
  1499.  
  1500.    BUGS
  1501.     The Scaliger period is defined to 3268!!!.
  1502.  
  1503.    SEE ALSO
  1504.     JYearToScaliger(),GYearToScaliger()
  1505.  
  1506. Date/JDtoMJD                                                     Date/JDtoMJD
  1507.  
  1508.    NAME
  1509.     JDtoMJD -- Switches from JD to MJD. (V33)
  1510.  
  1511.    SYNOPSIS
  1512.     mjd := JDtoMJD(jd);
  1513.  
  1514.     PROCEDURE JDtoMJD(jd : LONGINT) : LONGINT;
  1515.  
  1516.    FUNCTION
  1517.     Returns the Modified Julianday of a Julianday.
  1518.  
  1519.    INPUTS
  1520.     jd - Julianday
  1521.  
  1522.    RESULT
  1523.     mjd - The Modified Julianday
  1524.  
  1525.    EXAMPLE
  1526.     ...
  1527.     mjd := JDtoMJD(2449354);
  1528.     ...
  1529.  
  1530.    NOTES
  1531.     none
  1532.  
  1533.    BUGS
  1534.     Only use this funktion for jd > 2400001, because mjd is only
  1535.     defined for this, otherwise system will crash!
  1536.  
  1537.    SEE ALSO
  1538.     MJDtoJD()
  1539.  
  1540. Date/JDToTime                                                   Date/JDToTime
  1541.  
  1542.    NAME
  1543.     JDToTime -- Returns the real time for a JD time. (V33)
  1544.  
  1545.    SYNOPSIS
  1546.     JDToTime(jd,rhour,rmin,rsec);
  1547.  
  1548.     PROCEDURE JDToTime(jd : REAL; VAR rhour,rmin,rsec : SHORTINT);
  1549.  
  1550.    FUNCTION
  1551.     Returns the real time for a JD time.
  1552.  
  1553.    INPUTS
  1554.     jd - JD time
  1555.  
  1556.    RESULT
  1557.     rhour - 24 hour real time
  1558.     rmin  - real minutes
  1559.     rsec  - real seconds
  1560.  
  1561.    EXAMPLE
  1562.     ...
  1563.     JDToTime(0.76543,rhour,rmin,rsec);
  1564.     ...
  1565.  
  1566.    NOTES
  1567.     none.
  1568.  
  1569.    BUGS
  1570.     If jd is > 0 (including days) there will be occur arithmetic bugs!
  1571.  
  1572.    SEE ALSO
  1573.     TimeToJD()
  1574.  
  1575. Date/JSYearToJD                                               Date/JSYearToJD
  1576.  
  1577.    NAME
  1578.     JSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  1579.  
  1580.    SYNOPSIS
  1581.     jd := JSYearToJD(syear);
  1582.  
  1583.     PROCEDURE JSYearToJD(syear : INTEGER) : LONGINT;
  1584.  
  1585.    FUNCTION
  1586.     Returns the Julianday of a Scaliger year.
  1587.  
  1588.    INPUTS
  1589.     syear     - Scaliger year
  1590.  
  1591.    RESULT
  1592.     jd - The Julianday
  1593.  
  1594.    EXAMPLE
  1595.     ...
  1596.     jd := JSYearToJD(4800);
  1597.     ...
  1598.  
  1599.    NOTES
  1600.     Its better to use this fkt only from 4707 to 6295!
  1601.  
  1602.    BUGS
  1603.     unknown.
  1604.  
  1605.    SEE ALSO
  1606.     GSYearToJD(),HSYearToJD()
  1607.  
  1608. Date/JulianDayDiff                                         Date/JulianDayDiff
  1609.  
  1610.    NAME
  1611.     JulianDayDiff -- Calculates the days between 2 dates. (V33)
  1612.  
  1613.    SYNOPSIS
  1614.     days := JulianDayDiff(day1,month1,year1,day2,month2,year2);
  1615.  
  1616.     PROCEDURE JulianDayDiff(day1,month1 : SHORTINT; year1 : INTEGER;
  1617.         day2,month2 : SHORTINT; year2 : INTEGER) : LONGINT;
  1618.  
  1619.    FUNCTION
  1620.     JulianDayDiff gives you back the number of days between
  1621.     two specified dates.
  1622.  
  1623.    INPUTS
  1624.     day1   - day of the first date
  1625.     month1 - month of the first date
  1626.     year1  - year of the first date
  1627.     day2   - day of the second date
  1628.     month2 - month of the second month
  1629.     year2  - year of the second date
  1630.  
  1631.    RESULT
  1632.     days - The number of days between the two dates
  1633.         (positive if date1 <= date2).
  1634.  
  1635.    EXAMPLE
  1636.     ...
  1637.     days := JulianDayDiff(18,9,1970,22,1,1994);
  1638.     WriteString("Age of Kai Hofmann in days : ");
  1639.     WriteInt(days,10); WriteLn;
  1640.     ...
  1641.  
  1642.    NOTES
  1643.     Its is better only to use this function for years from -7 to 1582!
  1644.  
  1645.    BUGS
  1646.     No known bugs.
  1647.  
  1648.    SEE ALSO
  1649.     GregorianDayDiff(),HeisDayDiff(),JulianMonthDays(),JulianYearDays()
  1650.  
  1651. Date/JulianDayGreater                                   Date/JulianDayGreater
  1652.  
  1653.    NAME
  1654.     JulianDayGreater -- Checks if date1 is greater than date2. (V33)
  1655.  
  1656.    SYNOPSIS
  1657.     greater := JulianDayGreater(day1,month1,year1,day2,month2,year2);
  1658.  
  1659.     PROCEDURE JulianDayGreater(day1,month1 : SHORTINT; year1 : INTEGER;
  1660.         day2,month2 : SHORTINT; year2 : INTEGER) : BOOLEAN;
  1661.  
  1662.    FUNCTION
  1663.     JulianDayGreater test if date1 is greater than date2.
  1664.  
  1665.    INPUTS
  1666.     day1   - day of the first date
  1667.     month1 - month of the first date
  1668.     year1  - year of the first date
  1669.     day2   - day of the second date
  1670.     month2 - month of the second month
  1671.     year2  - year of the second date
  1672.  
  1673.    RESULT
  1674.     greater - This is TRUE is date1 > date2 otherwise it's FALSE.
  1675.  
  1676.    EXAMPLE
  1677.     ...
  1678.     IF JulianDayGreater(18,9,1970,22,1,1994) THEN
  1679.       WriteString(">"); WriteLn;
  1680.     ELSE
  1681.       WriteString("<="); WriteLn;
  1682.     END;
  1683.     ...
  1684.  
  1685.    NOTES
  1686.     Its is better only to use this function for years from -7 to 1582!
  1687.  
  1688.    BUGS
  1689.     No known bugs.
  1690.  
  1691.    SEE ALSO
  1692.     GregorianDayGreater(),HeisDayGreater()
  1693.  
  1694. Date/JulianDaysAfterWeekday                       Date/JulianDaysAfterWeekday
  1695.  
  1696.    NAME
  1697.     JulianDaysAfterWeekday -- Returns the diff to the wday after. (V33)
  1698.  
  1699.    SYNOPSIS
  1700.     days := JulianDaysAfterWeekday(day,month,year,weekday);
  1701.  
  1702.     PROCEDURE JulianDaysAfterWeekday(day,month : SHORTINT;
  1703.         year : INTEGER; weekday : Weekdays) : SHORTINT;
  1704.  
  1705.    FUNCTION
  1706.     Returns the days to the weekday after the specified date.
  1707.     So if you specifie the 22.1.1994 (saturday) and thursday
  1708.     you get back 5!
  1709.     If you specifie the 22.1.1994 and saturday you became back 0
  1710.     (the same day)!
  1711.  
  1712.    INPUTS
  1713.     day     - day of the date
  1714.     month   - month of the date
  1715.     year    - year of the date
  1716.     weekday - weekday to search for building difference
  1717.  
  1718.    RESULT
  1719.     days - The days after to the searched weekday.
  1720.  
  1721.    EXAMPLE
  1722.     ...
  1723.     days := JulianDaysAfterWeekday(22,1,1994,thursday);
  1724.     ...
  1725.  
  1726.    NOTES
  1727.     Its better to use this fkt only from -7 to 1582!
  1728.  
  1729.    BUGS
  1730.     See JulianWeekday()!
  1731.  
  1732.    SEE ALSO
  1733.     GregorianDaysAfterWeekday(),HeisDaysAfterWeekday(),JulianWeekday()
  1734.  
  1735. Date/JulianDaysBeforeWeekday                     Date/JulianDaysBeforeWeekday
  1736.  
  1737.    NAME
  1738.     JulianDaysBeforeWeekday -- Returns the diff to the wday before. (V33)
  1739.  
  1740.    SYNOPSIS
  1741.     days := JulianDaysBeforeWeekday(day,month,year,weekday);
  1742.  
  1743.     PROCEDURE JulianDaysBeforeWeekday(day,month : SHORTINT;
  1744.         year : INTEGER; weekday : Weekdays) : SHORTINT;
  1745.  
  1746.    FUNCTION
  1747.     Returns the days to the weekday before the specified date.
  1748.     So if you specifie the 22.1.1994 (saturday) and thursday
  1749.     you get back 2!
  1750.     If you specifie the 22.1.1994 and saturday you became back 0
  1751.     (the same day)!
  1752.  
  1753.    INPUTS
  1754.     day     - day of the date
  1755.     month   - month of the date
  1756.     year    - year of the date
  1757.     weekday - weekday to search for building difference
  1758.  
  1759.    RESULT
  1760.     days - The days back to the searched weekday (0-6)
  1761.         If you get back 8 an error occurs!
  1762.  
  1763.    EXAMPLE
  1764.     ...
  1765.     days := JulianDaysBeforeWeekday(22,1,1994,thursday);
  1766.     ...
  1767.  
  1768.    NOTES
  1769.     Its better to use this fkt only from -7 to 1582!
  1770.  
  1771.    BUGS
  1772.     See JulianWeekday()!
  1773.  
  1774.    SEE ALSO
  1775.     GregorianDaysBeforeWeekday(),HeisDaysBeforeWeekday(),JulianWeekday()
  1776.  
  1777. Date/JulianDaySmaller                                   Date/JulianDaySmaller
  1778.  
  1779.    NAME
  1780.     JulianDaySmaller -- Checks if date1 is smaller than date2. (V33)
  1781.  
  1782.    SYNOPSIS
  1783.     smaller := JulianDaySmaller(day1,month1,year1,day2,month2,year2);
  1784.  
  1785.     PROCEDURE JulianDaySmaller(day1,month1 : SHORTINT; year1 : INTEGER;
  1786.         day2,month2 : SHORTINT; year2 : INTEGER) : BOOLEAN;
  1787.  
  1788.    FUNCTION
  1789.     JulianDaySmaller test if date1 is smaller than date2.
  1790.  
  1791.    INPUTS
  1792.     day1   - day of the first date
  1793.     month1 - month of the first date
  1794.     year1  - year of the first date
  1795.     day2   - day of the second date
  1796.     month2 - month of the second month
  1797.     year2  - year of the second date
  1798.  
  1799.    RESULT
  1800.     smaller - This is TRUE is date1 < date2 otherwise it's FALSE.
  1801.  
  1802.    EXAMPLE
  1803.     ...
  1804.     IF JulianDaySmaller(18,9,1970,22,1,1994) THEN
  1805.       WriteString("<"); WriteLn;
  1806.     ELSE
  1807.       WriteString(">="); WriteLn;
  1808.     END;
  1809.     ...
  1810.  
  1811.    NOTES
  1812.     Its is better only to use this function for years from -7 to 1582!
  1813.  
  1814.    BUGS
  1815.     No known bugs.
  1816.  
  1817.    SEE ALSO
  1818.     GregorianDaySmaller(),HeisDaySmaller()
  1819.  
  1820. Date/JulianDiffDate                                       Date/JulianDiffDate
  1821.  
  1822.    NAME
  1823.     JulianDiffDate -- Returns the date for a diff to another date. (V33)
  1824.  
  1825.    SYNOPSIS
  1826.     JulianDiffDate(day,month,year,diffdays,dday,dmonth,dyear);
  1827.  
  1828.     PROCEDURE JulianDiffDate(day,month : SHORTINT; year,days : INTEGER;
  1829.         VAR dday,dmonth : SHORTINT; VAR dyear : INTEGER);
  1830.  
  1831.    FUNCTION
  1832.     Returns the date wich lies diffdays before/after the specified date.
  1833.  
  1834.    INPUTS
  1835.     day      - day of the date
  1836.     month    - month of the date
  1837.     year     - year of the date
  1838.     diffdays - difference to the date in days
  1839.  
  1840.    RESULT
  1841.     dday   - Destination day
  1842.     dmonth - Destination month
  1843.     dyear  - Destination year
  1844.  
  1845.    EXAMPLE
  1846.     ...
  1847.     JulianDiffDate(23,1,1994,7,dday,dmonth,dyear);
  1848.     ...
  1849.  
  1850.    NOTES
  1851.     Its better to use this fkt only from -7 to 1582!
  1852.  
  1853.    BUGS
  1854.     unknown.
  1855.  
  1856.    SEE ALSO
  1857.     GregorianDiffDate(),HeisDiffDate(),JulianDayDiff(),JulianMonthDays()
  1858.  
  1859. Date/JulianLeapYear                                       Date/JulianLeapYear
  1860.  
  1861.    NAME
  1862.     JulianLeapYear -- Checks if a year is a leap year for jj. (V33)
  1863.  
  1864.    SYNOPSIS
  1865.     leapyear := JulianLeapYear(year);
  1866.  
  1867.     PROCEDURE JulianLeapYear(year : INTEGER) : BOOLEAN;
  1868.  
  1869.    FUNCTION
  1870.     JulianLeapYear checks if a year is a leap year in the julian calendar
  1871.     For years after Chr. it checks if the year is dividable by 4.
  1872.     For years before Chr. a leap year must have a modulo 4 value of 1
  1873.  
  1874.    INPUTS
  1875.     year - The year which should be checked (from -32768 to 32767)
  1876.         I think only values from -7 to 1582 are valid, because of
  1877.         the variant that was done on -8 by Augustus!
  1878.  
  1879.    RESULT
  1880.     leapyear - TRUE if the year is a leap year, otherwise false.
  1881.  
  1882.    EXAMPLE
  1883.     ...
  1884.     IF JulianLeapYear(1994) THEN
  1885.       WriteString("leap year!");
  1886.     ELSE
  1887.       WriteString("no leap year!");
  1888.     END;
  1889.     WriteLn;
  1890.     ...
  1891.  
  1892.    NOTES
  1893.     A year is 365.25 days long!
  1894.     Use this function only for values from -7 to 1582!
  1895.  
  1896.    BUGS
  1897.     No known bugs.
  1898.  
  1899.    SEE ALSO
  1900.     GregorianLeapYear(),HeisLeapYear()
  1901.  
  1902. Date/JulianMonthDays                                     Date/JulianMonthDays
  1903.  
  1904.    NAME
  1905.     JulianMonthDays -- Gives back the number of days of a month. (V33)
  1906.  
  1907.    SYNOPSIS
  1908.     days := JulianMonthDays(month,year);
  1909.  
  1910.     PROCEDURE JulianMonthDays(month : SHORTINT;
  1911.         year : INTEGER) : SHORTINT;
  1912.  
  1913.    FUNCTION
  1914.     JulianMonthDays gives you back the number of days a month in
  1915.     a specified year have.
  1916.  
  1917.    INPUTS
  1918.     month - The month from wich you want to get the number of days.
  1919.     year  - The year in which the month is.
  1920.  
  1921.    RESULT
  1922.     days - The number of days the month uses, or 0 if you use
  1923.         a wrong month.
  1924.  
  1925.    EXAMPLE
  1926.     ...
  1927.     days := JulianMonthDays(1,1994);
  1928.     WriteString("Days of January 1994 : ");
  1929.     WriteCard(days,2); WriteLn;
  1930.     ...
  1931.  
  1932.    NOTES
  1933.     Its is better only to use this function for years from -7 to 1582!
  1934.  
  1935.    BUGS
  1936.     No known bugs.
  1937.  
  1938.    SEE ALSO
  1939.     JulianLeapYear(),GregorianMonthDays(),HeisMonthDays()
  1940.  
  1941. Date/JulianToJD                                               Date/JulianToJD
  1942.  
  1943.    NAME
  1944.     JulianToJD -- Returns the JD for a date. (V33)
  1945.  
  1946.    SYNOPSIS
  1947.     jd := JulianToJD(day,month,year);
  1948.  
  1949.     PROCEDURE JulianToJD(day,month : SHORTINT;
  1950.         year : INTEGER) : LONGINT;
  1951.  
  1952.    FUNCTION
  1953.     Returns the JD for a Julian date.
  1954.  
  1955.    INPUTS
  1956.     day      - day of the date to convert
  1957.     month    - month of the date to convert
  1958.     year     - year of the date to convert
  1959.  
  1960.    RESULT
  1961.     jd - This is the JD
  1962.  
  1963.    EXAMPLE
  1964.     ...
  1965.     jd := JulianToJD(23,1,1994);
  1966.     ...
  1967.  
  1968.    NOTES
  1969.     Its better to use this fkt only from -7 to 1582!
  1970.  
  1971.    BUGS
  1972.     unknown.
  1973.  
  1974.    SEE ALSO
  1975.     GregorianToJD(),HeisToJD(),JSYearToJD(),JYearToScaliger(),
  1976.     JulianDayDiff()
  1977.  
  1978. Date/JulianWeek                                               Date/JulianWeek
  1979.  
  1980.    NAME
  1981.     JulianWeek -- Gets the weeknumber of a specified date. (V33)
  1982.  
  1983.    SYNOPSIS
  1984.     weeknr := JulianWeek(day,month,year);
  1985.  
  1986.     PROCEDURE JulianWeek(day,month : SHORTINT;
  1987.         year : INTEGER) : SHORTINT;
  1988.  
  1989.    FUNCTION
  1990.     JulianWeek gets the weeknumber for a specified date.
  1991.  
  1992.    INPUTS
  1993.     day   - day of the date
  1994.     month - month of the date
  1995.     year  - year of the date
  1996.  
  1997.    RESULT
  1998.     week - This is the number of the week the specified date lies in.
  1999.         If the first day in a new year is a freiday, saturday or
  2000.         sunday, this would be the last week of the last year!
  2001.         If the 29.12. is a monday, the 30.12. is a monday or a tuesday,
  2002.         the 31.12. is a monday, tuesday or a wednesday this is the
  2003.         first week of the next year!
  2004.  
  2005.    EXAMPLE
  2006.     ...
  2007.     weeknr := JulianWeek(4,10,1582);
  2008.     ...
  2009.  
  2010.    NOTES
  2011.     Its is better only to use this function for years from 0 to 1582!
  2012.  
  2013.    BUGS
  2014.     For years < 0 errors could occur.
  2015.  
  2016.    SEE ALSO
  2017.     GregorianWeek(),HeisWeek(),JulianWeekday(),JulianDayDiff(),
  2018.     JulianDaySmaller()
  2019.  
  2020. Date/JulianWeekday                                         Date/JulianWeekday
  2021.  
  2022.    NAME
  2023.     JulianWeekday -- Gets the weekday of a specified date. (V33)
  2024.  
  2025.    SYNOPSIS
  2026.     weekday := JulianWeekday(day,month,year);
  2027.  
  2028.     PROCEDURE JulianWeekday(day,month : SHORTINT;
  2029.         year : INTEGER) : Weekday;
  2030.  
  2031.    FUNCTION
  2032.     JulianWeekday gets the weekday for a specified date.
  2033.  
  2034.    INPUTS
  2035.     day   - day of the date
  2036.     month - month of the date
  2037.     year  - year of the date
  2038.  
  2039.    RESULT
  2040.     weekday - This result is of type:
  2041.         Weekdays = (dayerr,monday,tuesday,wednesday,thursday,freiday,
  2042.         saturday,sunday);
  2043.         dayerr will show you, that an error occurs!
  2044.  
  2045.    EXAMPLE
  2046.     ...
  2047.     weekday := JulianWeekday(4,10,1582);
  2048.     IF weekday = dayerr THEN
  2049.     ...
  2050.     END;
  2051.     ...
  2052.  
  2053.    NOTES
  2054.     Its is better only to use this function for years from 0 to 1582!
  2055.     In this version no dayerr will occur!
  2056.  
  2057.    BUGS
  2058.     For years < 0 errors could occur, or systemcrashs(?).
  2059.  
  2060.    SEE ALSO
  2061.     GregorianWeekday(),HeisWeekday()
  2062.  
  2063. Date/JulianYearDays                                       Date/JulianYearDays
  2064.  
  2065.    NAME
  2066.     JulianYearDays -- Gives back the number of days in a year. (V33)
  2067.  
  2068.    SYNOPSIS
  2069.     days := JulianYearDays(year);
  2070.  
  2071.     PROCEDURE JulianYearDays(year : INTEGER) : INTEGER;
  2072.  
  2073.    FUNCTION
  2074.     JulianYearDays gives you back the number of days in
  2075.     a specified year.
  2076.  
  2077.    INPUTS
  2078.     year  - The year in which to count the days.
  2079.  
  2080.    RESULT
  2081.     days - The number of days the year uses.
  2082.  
  2083.    EXAMPLE
  2084.     ...
  2085.     days := JulianYearDays(1994);
  2086.     WriteString("Days of 1994 : ");
  2087.     WriteCard(days,3); WriteLn;
  2088.     ...
  2089.  
  2090.    NOTES
  2091.     Its is better only to use this function for years from -7 to 1582!
  2092.  
  2093.    BUGS
  2094.     No known bugs.
  2095.  
  2096.    SEE ALSO
  2097.     JulianMonthDays(),GregorianYearDays(),HeisYearDays()
  2098.  
  2099. Date/JYearToScaliger                                     Date/JYearToScaliger
  2100.  
  2101.    NAME
  2102.     JYearToScaliger -- Returns the year as Scaliger year. (V33)
  2103.  
  2104.    SYNOPSIS
  2105.     syear := JYearToScaliger(year);
  2106.  
  2107.     PROCEDURE JYearToScaliger(year : INTEGER) : INTEGER;
  2108.  
  2109.    FUNCTION
  2110.     Returns the Scaliger year.
  2111.  
  2112.    INPUTS
  2113.     year     - Julian year
  2114.  
  2115.    RESULT
  2116.     syear - The Scaliger year
  2117.  
  2118.    EXAMPLE
  2119.     ...
  2120.     syear := JYearToScaliger(1582);
  2121.     ...
  2122.  
  2123.    NOTES
  2124.     Its better to use this fkt only from -7 to 1582!
  2125.  
  2126.    BUGS
  2127.     unknown.
  2128.  
  2129.    SEE ALSO
  2130.     GYearToScaliger(),HYearToScaliger()
  2131.  
  2132. Date/LMT                                                             Date/LMT
  2133.  
  2134.    NAME
  2135.     LMT -- Calculates your local time in your timezone (V33)
  2136.  
  2137.    SYNOPSIS
  2138.     secs := LMT(secs,meridian,pos);
  2139.  
  2140.     PROCEDURE LMT(secs : LONGINT; meridiandegree,
  2141.         posdegree : REAL) : LONGINT;
  2142.  
  2143.    FUNCTION
  2144.     Calculates your Local Mean Time of you place!
  2145.  
  2146.    INPUTS
  2147.     secs     - Seconds of the running day (hours*3600+min*60+sec)
  2148.     meridian - Degrees of your timezone-meridian
  2149.     pos      - Degrees of your place
  2150.  
  2151.    RESULT
  2152.     secs - Local seconds of the running day
  2153.  
  2154.    EXAMPLE
  2155.     ...
  2156.     secs := LMT(76080,15.0,8.923055556);
  2157.     ...
  2158.  
  2159.    NOTES
  2160.     none
  2161.  
  2162.    BUGS
  2163.     No errorcheck, if you put in valid degrees (-180 to +180)
  2164.  
  2165.    SEE ALSO
  2166.  
  2167.  
  2168. Date/MJDtoJD                                                     Date/MJDtoJD
  2169.  
  2170.    NAME
  2171.     MJDtoJD -- Switches from MJD to JD. (V33)
  2172.  
  2173.    SYNOPSIS
  2174.     jd := MJDtoJD(mjd);
  2175.  
  2176.     PROCEDURE MJDtoJD(mjd : LONGINT) : LONGINT;
  2177.  
  2178.    FUNCTION
  2179.     Returns the Julianday of a Modified Julianday.
  2180.  
  2181.    INPUTS
  2182.     mjd - Modified Julianday
  2183.  
  2184.    RESULT
  2185.     jd - The Julianday
  2186.  
  2187.    EXAMPLE
  2188.     ...
  2189.     jd := JDtoMJD(49353);
  2190.     ...
  2191.  
  2192.    NOTES
  2193.     none
  2194.  
  2195.    BUGS
  2196.     unknown.
  2197.  
  2198.    SEE ALSO
  2199.     MJDtoJD()
  2200.  
  2201. Date/ScaligerYearToG                                     Date/ScaligerYearToG
  2202.  
  2203.    NAME
  2204.     ScaligerYearToG -- Returns the Scaliger year as Gregorian year. (V33)
  2205.  
  2206.    SYNOPSIS
  2207.     year := ScaligerYearToG(syear);
  2208.  
  2209.     PROCEDURE ScaligerYearToG(syear : INTEGER) : INTEGER;
  2210.  
  2211.    FUNCTION
  2212.     Returns the Gregorian year of a Scaliger year.
  2213.  
  2214.    INPUTS
  2215.     syear     - Scaliger year
  2216.  
  2217.    RESULT
  2218.     year - The Gregorian year
  2219.  
  2220.    EXAMPLE
  2221.     ...
  2222.     year := ScaligerYearToG(6400);
  2223.     ...
  2224.  
  2225.    NOTES
  2226.     Its better to use this fkt only from 4707 to 7981!
  2227.  
  2228.    BUGS
  2229.     unknown.
  2230.  
  2231.    SEE ALSO
  2232.     ScaligerYearToJ(),ScaligerYearToH()
  2233.  
  2234. Date/ScaligerYearToH                                     Date/ScaligerYearToH
  2235.  
  2236.    NAME
  2237.     ScaligerYearToH -- Returns the Scaliger year as Heis year. (V33)
  2238.  
  2239.    SYNOPSIS
  2240.     year := ScaligerYearToH(syear);
  2241.  
  2242.     PROCEDURE ScaligerYearToH(syear : INTEGER) : INTEGER;
  2243.  
  2244.    FUNCTION
  2245.     Returns the Heis year of a Scaliger year.
  2246.  
  2247.    INPUTS
  2248.     syear     - Scaliger year
  2249.  
  2250.    RESULT
  2251.     year - The Heis year
  2252.  
  2253.    EXAMPLE
  2254.     ...
  2255.     year := ScaligerYearToH(7000);
  2256.     ...
  2257.  
  2258.    NOTES
  2259.     Its better to use this fkt only from 4707 to 7981!
  2260.  
  2261.    BUGS
  2262.     unknown.
  2263.  
  2264.    SEE ALSO
  2265.     ScaligerYearToJ(),ScaligerYearToG()
  2266.  
  2267. Date/ScaligerYearToJ                                     Date/ScaligerYearToJ
  2268.  
  2269.    NAME
  2270.     ScaligerYearToJ -- Returns the Scaliger year as Julian year. (V33)
  2271.  
  2272.    SYNOPSIS
  2273.     year := ScaligerYearToJ(syear);
  2274.  
  2275.     PROCEDURE ScaligerYearToJ(syear : INTEGER) : INTEGER;
  2276.  
  2277.    FUNCTION
  2278.     Returns the Julian year of a Scaliger year.
  2279.  
  2280.    INPUTS
  2281.     syear     - Scaliger year
  2282.  
  2283.    RESULT
  2284.     year - The Julian year
  2285.  
  2286.    EXAMPLE
  2287.     ...
  2288.     year := ScaligerYearToJ(4800);
  2289.     ...
  2290.  
  2291.    NOTES
  2292.     Its better to use this fkt only from 4707 to 6295!
  2293.  
  2294.    BUGS
  2295.     unknown.
  2296.  
  2297.    SEE ALSO
  2298.     ScaligerYearToG(),ScaligerYearToH()
  2299.  
  2300. Date/SecToTime                                                 Date/SecToTime
  2301.  
  2302.    NAME
  2303.     SecToTime -- Returns the time from seconds (V33)
  2304.  
  2305.    SYNOPSIS
  2306.     SecToTime(secs,hour,min,sec);
  2307.  
  2308.     PROCEDURE SecToTime(secs : LONGINT; VAR hour,min,sec : SHORTINT);
  2309.  
  2310.    FUNCTION
  2311.     Gives you back the time from the specified seconds
  2312.  
  2313.    INPUTS
  2314.     secs - Time in seconds
  2315.  
  2316.    RESULT
  2317.     hour - hours (0-23)
  2318.     min  - minutes (0-59)
  2319.     sec  - seconds (0-59)
  2320.  
  2321.    EXAMPLE
  2322.     ...
  2323.     SecToTime(76860,hour,min,sec);
  2324.     ...
  2325.  
  2326.    NOTES
  2327.     Don't forget to convert 24h time to AM/PM time if needed!
  2328.  
  2329.    BUGS
  2330.     No errorcheck, if you use a valid time
  2331.  
  2332.    SEE ALSO
  2333.     TimeToSec()
  2334.  
  2335. Date/TimeToJD                                                   Date/TimeToJD
  2336.  
  2337.    NAME
  2338.     TimeToJD -- Returns the JD for a time. (V33)
  2339.  
  2340.    SYNOPSIS
  2341.     jd := TimeToJD(hour,min,sec);
  2342.  
  2343.     PROCEDURE TimeToJD(hour,min,sec : SHORTINT) : REAL;
  2344.  
  2345.    FUNCTION
  2346.     Returns the JD for a specified time.
  2347.  
  2348.    INPUTS
  2349.     hour - hour of the time to convert
  2350.     min  - minute of the time to convert
  2351.     sec  - sec. of the time to convert
  2352.  
  2353.    RESULT
  2354.     jd - This is the JD time
  2355.  
  2356.    EXAMPLE
  2357.     ...
  2358.     jd := TimeToJD(16,33,0);
  2359.     ...
  2360.  
  2361.    NOTES
  2362.     none
  2363.  
  2364.    BUGS
  2365.     There is no check, if the specified time is a valid time!
  2366.  
  2367.    SEE ALSO
  2368.     JDToTime()
  2369.  
  2370. Date/GregorianEaster                                     Date/GregorianEaster
  2371.  
  2372.    NAME
  2373.     GregorianEaster -- Returns the date of eastern in a year (V33)
  2374.  
  2375.    SYNOPSIS
  2376.     GregorianEaster(year,dday,dmonth);
  2377.  
  2378.     PROCEDURE GregorianEaster(year : INTEGER;
  2379.         VAR dday,dmonth : SHORTINT);
  2380.  
  2381.    FUNCTION
  2382.     Returns the date of eastern for a specified year.
  2383.  
  2384.    INPUTS
  2385.     year  - eastern is calculated for this year
  2386.  
  2387.    RESULT
  2388.     dday   - day of easter-sunday
  2389.     dmonth - month of easter-sunday
  2390.  
  2391.    EXAMPLE
  2392.     ...
  2393.     GregorianEaster(1994,dday,dmonth);
  2394.     ...
  2395.  
  2396.    NOTES
  2397.     Use this only for 1900 to 2099!
  2398.     Tested for 1977-1994! But this formula is from Gauß - so it must be
  2399.     correct :)
  2400.  
  2401.    BUGS
  2402.     None.
  2403.  
  2404.    SEE ALSO
  2405.     GEP(),GregorianJHSB()
  2406.  
  2407. Date/TimeToSec                                                 Date/TimeToSec
  2408.  
  2409.    NAME
  2410.     TimeToSec -- Returns the time in seconds (V33)
  2411.  
  2412.    SYNOPSIS
  2413.     secs := TimeToSec(hour,min,sec);
  2414.  
  2415.     PROCEDURE TimeToSec(hour,min,sec : SHORTINT) : LONGINT;
  2416.  
  2417.    FUNCTION
  2418.     Gives you back the time in seconds
  2419.  
  2420.    INPUTS
  2421.     hour - hours you want (0-23)
  2422.     min  - minutes you want (0-59)
  2423.     sec  - seconds you want (0-59)
  2424.  
  2425.    RESULT
  2426.     secs - Time in seconds
  2427.  
  2428.    EXAMPLE
  2429.     ...
  2430.     secs := TimeToSec(21,15,00);
  2431.     ...
  2432.  
  2433.    NOTES
  2434.     Don't forget to convert AM/PM time to 24h time!
  2435.  
  2436.    BUGS
  2437.     No errorcheck, if you use a valid time
  2438.  
  2439.    SEE ALSO
  2440.     SecToTime()
  2441.  
  2442. Date/TimeZoneFactor                                       Date/TimeZoneFactor
  2443.  
  2444.    NAME
  2445.     TimeZoneFactor -- Returns the value you have to add to GMT time (V33)
  2446.  
  2447.    SYNOPSIS
  2448.     addhours := TimeZoneFactor(degrees);
  2449.  
  2450.     PROCEDURE TimeZoneFactor(degree : SHORTINT) : SHORTINT;
  2451.  
  2452.    FUNCTION
  2453.     This gives you the hours you have to add to GMT time,
  2454.     specified on the fact, that a timezone is 15 degrees
  2455.     and that GMT is centered on 0 degrees!
  2456.  
  2457.    INPUTS
  2458.     degrees - Position of timezone you live in (from -180 to +180)
  2459.  
  2460.    RESULT
  2461.     addhours - Time to add to GMT time to get your locale zone time
  2462.         (-12 to +12)
  2463.  
  2464.    EXAMPLE
  2465.     ...
  2466.     addhours := TimeZoneFactor(-8);
  2467.     ...
  2468.  
  2469.    NOTES
  2470.     none
  2471.  
  2472.    BUGS
  2473.     No errorcheck, if you put in valid degrees (-180 to +180)
  2474.     Only full degrees are supportet, keep sure that you
  2475.     round in the right way for 0.x degree places
  2476.     I am not sure about the correct +/- behaviour!!!
  2477.  
  2478.    SEE ALSO
  2479.  
  2480.  
  2481.