home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / date-33.087.lha / Date-33.087 / doc / Date.doc
Encoding:
Text File  |  1994-04-13  |  58.9 KB  |  2,545 lines

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