Post Reply 
Calendar calculations.
01-13-2015, 12:33 PM
Post: #1
Calendar calculations.
Here is a little code which is needed for subject. It determine if year is Julian or Gregorian also if year is Leap or not. It is important to build a calendar.
Code:
EXPORT CALENDRIER()
BEGIN
LOCAL DATE:=0,J:=0,M:=0,AN:=0;
LOCAL GREG:=0,JUL:=0,GBISS:=0,JBISS:=0;
INPUT(DATE,"CALENDRIER","JJ.MMAAAA");

J:=IP(DATE);
M:=IP(FP(DATE)*100);
AN:=IP(FP(FP(DATE)*100)*10000);

IF(AN+M/100+J/10000)>1582.10145
  THEN 1▶GREG;
  ELSE 1▶JUL;
END;
IF (AN>1582 AND(irem(AN,4)==0 AND irem(AN,100)≠0) OR irem(AN,400)==0)
   THEN 1▶GBISS;0▶JBISS
   ELSE 
     IF (AN<1582 AND irem(AN,4)==0)
   THEN 1▶JBISS;0▶GBISS
   END;
END;
IF GREG==1 AND GBISS==1 THEN PRINT(AN+"GREG BISS");END;
IF GREG==1 AND GBISS==0 THEN PRINT(AN+"GREG ORDI");END;
IF JUL==1 AND JBISS==1 THEN PRINT(AN+"JUL BISS");END;
IF JUL==1 AND JBISS==0 THEN PRINT(AN+"JUL ORDI");END;
END;
After we are abble to do almost everythings for calendars.
Gérard.

Gérard.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Calendar calculations. - ggauny@live.fr - 01-13-2015 12:33 PM
RE: Calendar calculations. - Thomas_Sch - 01-13-2015, 02:46 PM



User(s) browsing this thread: 1 Guest(s)