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