Date: 02-16-2022
Return to Index
created by gbSnippets
'http://aa.usno.navy.mil/faq/docs/JD_Formula.php
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Function PBMain() As Long
End Function
Function JD (YEAR AS Long, MONTH As Long, DAY As Long) As Long
'COMPUTES THE JULIAN DATE (JD) GIVEN A GREGORIAN CALENDAR
Local YEAR,MONTH,DAY,I,J,K as Long
I= YEAR
J= MONTH
K= DAY
JD= K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12)
2 /12-3*((I+4900+(J-14)/12)/100)/4
End
Sub GDATE (JD As Long, YEAR AS Long,MONTH AS Long,DAY as Long)
C
C---COMPUTES THE GREGORIAN CALENDAR DATE (YEAR,MONTH,DAY)
C GIVEN THE JULIAN DATE (JD).
C
Local JD,YEAR,MONTH,DAY,I,J,K as Long
L= JD+68569
N= 4*L/146097
L= L-(146097*N+3)/4
I= 4000*(L+1)/1461001
L= L-1461*I/4+31
J= 80*L/2447
K= L-2447*J/80
L= J/11
J= J+2-12*L
I= 100*(N-49)+I+L
YEAR= I
MONTH= J
DAY= K
END
http://www.garybeene.com/sw/gbsnippets.htm