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