Hi, I often get error messages saying my obs are from the future! I use a self-written app in Visual Basic which has performed well up until recently, but having just tested I find I am having to subtract about 0.0412 from the final answer to get something which agrees with the actual time. Could someone just take a look to see if there is a problem with my routine please?
Public Function julian(Y As Integer, m As Integer, d As Integer) As Long
Dim a As Integer, b As Integer
a = Int(Y / 100)
b = 2 - a + Int(a / 4)
If m > 2 Then
'do nothing
Else
Y = Y - 1
m = m + 12
End If
julian = Int(365.25 * (Y + 4716)) + Int(30.6001 * (m + 1)) + d + b - 1524.5 + 0.5
End Function
fjd = julian(frmEntryscreen.nbYear.text, frmEntryscreen.nbMonth.text, frmEntryscreen.nbDay.text) + ((dechrs / 24) - 0.5)
fjd = fjd - 0.0412 '(this is the line I just put in)the variables above are got from text boxes in the app. They are all fine. In practice I add 1 minute to the ‘minute’ textbox to cater for the time between the values loading (from the laptop’s clock) and the making of the estimate.