Julian Date Calculator

The code on this page was written by me during my sophomore year at the

Department of Astronomy & Astrophysics, Villanova University, Villanova, PA 19085.

If you have been to this page before, you may elect to skip ahead to:
LEGAL STUFF: Feel free to copy and use the JavaScript code written for this homepage. All I ask is that the header at the at the beginning of the JavaScript code section is kept intact and is present in whatever you use it for. If you just want to add a link to my homepage instead, let me know so that I can put a link to your homepage too! :)

What is a Julian Day?

Everyone knows how to use the conventional date system with seven days a week, about 30 days a month, and 12 months a year (or at least I hope everyone does!). Such a system is very confusing - some months have 31 days, some 30, and the number of days in February change almost every four years! Most people learned and starting using this complicated date system at a very young age, so they face little or no problems with it. However programming a computer with such variable dates is a very difficult task indeed. Which is why we had to choose the simple way out: the Julian Date! In fact, the whole of science is about choosing the easy way out =) But I digress... my apologies. On this web page I shall explain and apply Julian Dates (JD) in context with astronomical dating methods, although a JD is (I am told) a more general concept.

In astronomy, a Julian Date is defined as the contiguous count of days from January 1, 4713 B.C., Greenwich Mean Noon (equal to zero hours Universal Time). The fraction of each day is represented as a decimal number. Hence noon (GMT) on January 2, 4713 B.C. would have JD 1.00000, 6.00 pm GMT on the same day would have JD 1.25000 and 6.00 hours Universal Time would have JD 2443509.75. Simple, right?

Well, not quite so simple. The irregularity of the conventional date system makes the date conversion formulae to find JD's rather tedious and complex. Being a sophomore at College, I am in no position to derive these formulae myself. The formulae used were given to me during our first semester Observational Astronomy Laboratory taught by Dr. G. P. McCook. I simply wrote the JavaScript code that implements these formulae and lets the computer do the number crunching. After all, that's what computers are good at, right?

Also you may ask, what's so special about January 1, 4713 B.C.? Well, according to Kevin Bourque, this day was chosen because, amongst other reasons, it is the most recent day in which the year began on a Sunday with a full moon. In addition, Kenneth Silverstein points out that the Julian Day count was:

  1. developed by Joseph Justus Scaliger in 1583 (1 year after the institution of the Gregorian calendar),
  2. named by Joseph in honour of his father Julius Caesar Scaliger, and
  3. day 1 was chosen as January 1, 4713 B.C. because the Julian Calendar, the Lunar Calendar (corresponding to Kevin Bourque's point) and the Roman Tax Calendar all coincided. This happens every 7,980 years, so the next coincidence will be in 3267 A.D.

According to one of my professors, there are hardly any scientific records of astronomical phenomena prior to that date anyway, so it seems like a good starting point. If anyone has further opinions, please let me know by e-mail!


Calendar (Gregorian) Dates to Julian Dates

This JavaScript code calculates the Julian Date for a given Universal (GMT + 12 hours) Date and Time. Enter the date in the correct syntax (examples are given below) and then click "Calculate Julian Date".

Example (with time specified): December 25, 1990 19:30:00
Example (without time specified): April 1, 1993

Enter date:
Fine print: Netscape's documentation says that JavaScript's Date object is for handling dates after 1/1/1970, and so earlier dates might not work. However, so far all dates prior to 1970 seem to have worked for me. Also, the Julian Date calculation formula is supposedly accurate only for the years 1800 - 2100 AD.

Julian Dates to Calendar (Gregorian) Dates

This JavaScript code converts Julian Dates back to normal Calendar (Gregorian) dates. The output is in GMT (Universal - 12 hours) time.

Example: 2443509.5

Enter Julian date:
Fine print: Again, according to Netscape's website, JavaScript's Date object wasn't created to work with dates prior to 1/1/1970. My tests have indicated no problems so far, but I cannot guarantee that this will work everytime.

Times of Minimum Table

What is a Times of Minimum Table?

Several objects seen in the night sky have been found to vary periodically with time. For example binary star systems can be pulsating, or simple stars like Polaris (the Pole Star) can vary in brightness (magnitude) with time. To observe these objects using telescopes, astronomers have to know at precisely what part of its cyclical phase the star is in so that they can calibrate their observations accordingly.

Often it is necessary to observe such objects over their entire cycle. Luckily, one doesn't have to observe these objects continuously over the complete period of the cycle. This is a great relief, especially since many objects have a period of more than one day! (Imagine the poor astronomer locked up in the tiny observatory room for days on end unable to take his eye off the instruments!) The observing can be split into several sessions, but to do so one must know exactly how to time these sessions such that one knows precisely when that particular phase of the cycle occurs. A Times of Minimum table is simply a table that, given the cyclical period of the star, lists a set of dates and times between the specified starting and ending dates. An astronomer can then observe the sky at these times and find that particular phase of the cycle occurring for that star. Try it below and see how easy it is!

This JavaScript code will calculate a Times of Minimum table given a starting date and an ending date. Enter the Calendar and Julian dates as shown in the examples above. To print the results, select "Print" under the "File" menu in the new window that the table appears in. I will be adding a feature to calculate the times using the local time instead of universal time soon. Also, some people may note that I don't ask for the star's phase for the calculation. I will be implementing that code soon, but till then please enter the Julian Date for a particular event for the known Time of Minimum.

Enter starting date:
Enter ending date:
Enter Julian date for any known time of minimum:
Enter period (duration of 1 complete cycle) of the event (in Julian days):