# jd algorithm

4 posts / 0 new
pox
jd algorithm

Hi all,

I have written an app that submits observations to webobs in the AAVSO visual format. Part of this app of course converts the calendar date to JD, and on several occasions error messages have been raised when attempting to upload a file. I thought that this was because of some inconsistency in the format, but it turns out that the algorithm I have been using (downloaded from the web) doesn't always return the correct JD!

Does anyone know of a reliable JD algorithm, preferably (though not necessarily) in Visual Basic?

You may contact me on mike@starman.co.uk if you want

Michael Poxon, Norwich, UK

PKV
My JD Converter for Excel

Mike,

Here is my JD Excel spreadsheet that I use in my archiving activity.

Kevin Paxson - PKV

roe
JD algorithm

The autoritative source for all things calculated in astronony is Jean Meeus' Astronomical Algorithms.  From pages 60-61.

"Let Y be the year, M the month number  and D the day of the month (with decimals, if any) of the calendar date.

If M>2, leave Y and M unchanged

If M=1 or M=2, replace Y by Y-1 and M by M+12  (In other words January and February are thought to be the 13th and 14th month of the previous year).

In the Gregorian calendar take

A= INT(Y/100) and B = 2-A+INT(A/4) where INT() implies the integer part of a number (NOT the rounded value).

JD = INT(365.25(Y+4716)) + INT(30.6001(M+1)) + D +B - 1524.5"

Note:  this is for Gregorian calendar dates only (Not Julian Calendar).  See Meeus for more details.

David Benn
Agreed. Meeus is the place to

Agreed. Meeus is the place to look. VStar implements the method in Meeus.

Here is Java source and unit test code.

Feel free to ask questions.

Regards,

David

Log in to post comments