Trailing-Edge
-
PDP-10 Archives
-
decuslib20-03
-
decus/20-0078/libsim/dayno.sim
There is 1 other file named dayno.sim in the archive. Click here to see a list.
OPTIONS(/E/C/-Q/-A/-I/-D);
EXTERNAL TEXT PROCEDURE today;
INTEGER PROCEDURE dayno;
!
Integer procedure DAYNO returns the ordinal day
number in current year.;
BEGIN
INTEGER day,month,year; TEXT t;
t:- today;
month:= t.Sub(6,2).Getint;
day:= 30*(month-1) + (4*month-7)//6;
IF month > 4 THEN day:= day - 1 ELSE
IF month = 2 THEN day:= day + 1;
IF month > 2 THEN
BEGIN year:= t.Getint;
day:= IF Mod(year,400) = 0 THEN day - 1 ELSE
day - Sign(Mod(year,4));
END After February;
dayno:= day + t.Sub(9,2).Getint;
END of dayno;