Post Reply 
(38G) Date to Julian Day Number & Life in Days
11-23-2016, 10:00 AM (This post was last modified: 06-15-2017 01:56 PM by Gene.)
Post: #1
(38G) Date to Julian Day Number & Life in Days
The programme LIFE displays a message, on successive days alternately in German & English, & the number of days since birth.

The sub-programme D2JDN takes as input the date as Ans from the Home Screen in the form MM.DDYYYY - this is the style of date returned by the function DATE - & returns the corresponding Julian Date Number.

D2JDN works for all dates, BC (entered as a negative number) & AD, prior to 1582 using Julian Calendar & avoiding the year 0.

Code:


LIFE

DATE:
RUN D2JDN:
Ans-2434606.5: Change this number to the Julian Date Number of the day before your birth.
IF Ans MOD 2
THEN
MSGBOX "Tag Deines
        Lebens
     "Ans:
ELSE
MSGBOX "Day of thy life
     "Ans:
END:

D2JDN

Ans►D:
SIGN(Ans)►S:
ABS(D)►D:
INT(Ans)►M:
Ans►N:
100*(D-Ans)►A:
INT(Ans)►D:
10000*(A-D)*S+(S==-1)►Y:
Ans►Z:
IF M<3
THEN
Z-1►Z:
N+12►N:
END:
IF Y+(M+D/100)/100≥1582.1015
THEN
INT(Z/100):
2-Ans+INT(Ans/4):
ELSE
0:
END:
Ans+
INT(365.25*Z-(S==-1)*.75)+
INT(30.6001*(N+1))+D+1720994.5:
Find all posts by this user
Quote this message in a reply
Post Reply 




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