With apologies to mr womp womp
I had some time to examine the code of mine he was kind enough to look over and make more efficient. I realized that a bug had crept into it for years in the Julian calendar so I made a small correction to it.
While doing this I decided that it would make better sense to enter in the date as YYYY.MMDD rather then as the way I originally had it as MMDD.YYYY. This is because the algorithm allows you to enter both positive and negative years so entering -333.1024 for 24 Oct, -333 makes better sense then -1024.0333
Code:
I had some time to examine the code of mine he was kind enough to look over and make more efficient. I realized that a bug had crept into it for years in the Julian calendar so I made a small correction to it.
While doing this I decided that it would make better sense to enter in the date as YYYY.MMDD rather then as the way I originally had it as MMDD.YYYY. This is because the algorithm allows you to enter both positive and negative years so entering -333.1024 for 24 Oct, -333 makes better sense then -1024.0333
Code:
ClrHome
Disp "ENTER DATE AS
Input "(YYYY.MMDD):",A
iPart(A→Y
iPart(1E2abs(A-Y)→M
1E2fPart(1E2abs(A-Y)→D
If M≤2:Then
Y-1→Y
M+12→M
End
If Y=1582 and M=10 and D>4 and D<15:4→D
0→A
If Y>1582 or (Y=1582 and M>10) or (Y=1582 and M=10 and D≥15):Then
int(sub(Y→A:2-A+int(A/4)→A:End
remainder(int(365.25(Y+4716))+int(30.6001(M+1))+D+A-1523,7