 DEFINITION MODULE Date;

 (*
 (*$ StackChk       := FALSE *)
 (*$ RangeChk       := FALSE *)
 (*$ OverflowChk    := FALSE *)
 (*$ NilChk         := FALSE *)
 (*$ CaseChk        := FALSE *)
 (*$ ReturnChk      := FALSE *)
 (*$ LargeVars      := FALSE *)
 (*$ EntryClear     := TRUE  *)
 (*$ Volatile       := TRUE  *)
 (*$ StackParms     := TRUE  *)
 (*$ CStrings       := TRUE  *)
 *)


 TYPE
	Weekdays	= (dayerr,
				monday,tuesday,wednesday,thursday,
						freiday,saturday,sunday);


 PROCEDURE JulianLeapYear(year : INTEGER) : BOOLEAN;
 PROCEDURE GregorianLeapYear(year : INTEGER) : BOOLEAN;
 PROCEDURE HeisLeapYear(year : INTEGER) : BOOLEAN;
 PROCEDURE JulianMonthDays(month : SHORTCARD; year : INTEGER) : SHORTCARD;
 PROCEDURE GregorianMonthDays(month : SHORTCARD; year : INTEGER) : SHORTCARD;
 PROCEDURE HeisMonthDays(month : SHORTCARD; year : INTEGER) : SHORTCARD;
 PROCEDURE JulianYearDays(year : INTEGER) : CARDINAL;
 PROCEDURE GregorianYearDays(year : INTEGER) : CARDINAL;
 PROCEDURE HeisYearDays(year : INTEGER) : CARDINAL;
 PROCEDURE JulianDaySmaller(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
 PROCEDURE GregorianDaySmaller(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
 PROCEDURE HeisDaySmaller(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
 PROCEDURE JulianDayGreater(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
 PROCEDURE GregorianDayGreater(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
 PROCEDURE HeisDayGreater(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
 PROCEDURE JulianDayDiff(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : LONGINT;
 PROCEDURE GregorianDayDiff(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : LONGINT;
 PROCEDURE HeisDayDiff(day1,month1 : SHORTCARD; year1 : INTEGER;
			day2,month2 : SHORTCARD; year2 : INTEGER) : LONGINT;
 PROCEDURE JulianWeekday(day,month : SHORTCARD; year : INTEGER) : Weekdays;
 PROCEDURE GregorianWeekday(day,month : SHORTCARD; year : INTEGER) : Weekdays;
 PROCEDURE HeisWeekday(day,month : SHORTCARD; year : INTEGER) : Weekdays;
 PROCEDURE JulianDaysBeforeWeekday(day,month : SHORTCARD;
			year : INTEGER; weekday : Weekdays) : SHORTCARD;
 PROCEDURE GregorianDaysBeforeWeekday(day,month : SHORTCARD;
			year : INTEGER; weekday : Weekdays) : SHORTCARD;
 PROCEDURE HeisDaysBeforeWeekday(day,month : SHORTCARD;
			year : INTEGER; weekday : Weekdays) : SHORTCARD;
 PROCEDURE JulianDaysAfterWeekday(day,month : SHORTCARD;
			year : INTEGER; weekday : Weekdays) : SHORTCARD;
 PROCEDURE GregorianDaysAfterWeekday(day,month : SHORTCARD;
			year : INTEGER; weekday : Weekdays) : SHORTCARD;
 PROCEDURE HeisDaysAfterWeekday(day,month : SHORTCARD;
			year : INTEGER; weekday : Weekdays) : SHORTCARD;
 PROCEDURE JulianDiffDate(day,month : SHORTCARD;
	year,days : INTEGER; VAR dday,dmonth : SHORTCARD; VAR dyear : INTEGER);
 PROCEDURE GregorianDiffDate(day,month : SHORTCARD;
	year,days : INTEGER; VAR dday,dmonth : SHORTCARD; VAR dyear : INTEGER);
 PROCEDURE HeisDiffDate(day,month : SHORTCARD;
	year,days : INTEGER; VAR dday,dmonth : SHORTCARD; VAR dyear : INTEGER);
 PROCEDURE JYearToScaliger(year : INTEGER) : CARDINAL;
 PROCEDURE GYearToScaliger(year : INTEGER) : CARDINAL;
 PROCEDURE HYearToScaliger(year : INTEGER) : CARDINAL;
 PROCEDURE ScaligerYearToJ(syear : CARDINAL) : INTEGER;
 PROCEDURE ScaligerYearToG(syear : CARDINAL) : INTEGER;
 PROCEDURE ScaligerYearToH(syear : CARDINAL) : INTEGER;
 PROCEDURE JSYearToJD(syear : CARDINAL) : LONGCARD;
 PROCEDURE GSYearToJD(syear : CARDINAL) : LONGCARD;
 PROCEDURE HSYearToJD(syear : CARDINAL) : LONGCARD;
 PROCEDURE JDtoMJD(jd : LONGCARD) : LONGCARD;
 PROCEDURE MJDtoJD(mjd : LONGCARD) : LONGCARD;
 PROCEDURE JulianToJD(day,month : SHORTCARD; year : INTEGER) : LONGCARD;
 PROCEDURE GregorianToJD(day,month : SHORTCARD; year : INTEGER) : LONGCARD;
 PROCEDURE HeisToJD(day,month : SHORTCARD; year : INTEGER) : LONGCARD;
 PROCEDURE TimeToJD(hour,min,sec : SHORTCARD) : REAL;
 PROCEDURE JDToTime(jd : REAL; VAR rhour,rmin,rsec : SHORTCARD);
 PROCEDURE GregorianMoonAge(day,month : SHORTCARD; year : INTEGER) : SHORTCARD;
 PROCEDURE GregorianEaster(year : INTEGER; VAR dday,dmonth : SHORTCARD);
 PROCEDURE TimeZoneFactor(degree : SHORTINT) : SHORTINT;
 PROCEDURE LMT(secs : LONGCARD; meridiandegree, posdegree : REAL) : LONGINT;
 PROCEDURE TimeToSec(hour,min,sec : SHORTCARD) : LONGCARD;
 PROCEDURE SecToTime(secs : LONGCARD; VAR hour,min,sec : SHORTCARD);
 PROCEDURE JulianWeek(day,month : SHORTCARD; year : INTEGER) : SHORTCARD;
 PROCEDURE GregorianWeek(day,month : SHORTCARD; year : INTEGER) : SHORTCARD;
 PROCEDURE HeisWeek(day,month : SHORTCARD; year : INTEGER) : SHORTCARD;

 END Date.
