Share | home | contents | send comment | send link | add bookmark |

Julian Day Number from Coordinated Universal Time

by Stephen R. Schmitt

Coordinated Universal Time:
/ /     : :

Julian day number:


  1. About
  2. The source code
  3. Discussion

1. About

This Java Script calculator performs two operations; it converts Coordinated Universal Time (UTC) in the Gregorian calendar to a Julian Day number (JD), and it converts JD to the UTC in the Gregorian calendar. To operate the calculator, enter the UTC and press the Compute JD button to compute the day number. Or, enter a day number and press the Compute UTC button to obtain the corresponding UTC. On invalid entries, a popup window will display an error message.

Return to Contents

2. The source code

The Java Script source code for this program can be viewed by using the View|Source command of your web browser.

You may use or modify this source code in any way you find useful, provided that you agree that the author has no warranty, obligations or liability. You must determine the suitability of this source code for your use.

Return to Contents

3. Discussion

Many astronomical formulas require a date and time to model astronomical events. A time measure that is a combination of years, months, days, hours, minutes, and seconds greatly simplifies these models. The Julian Day Number gives astronomers a single time reference for this purpose. As an example, below is shown a method for calculating the local sidereal time:

Get the Julian Day number relative to Jan 1.5, 2000
jd  = julian_day_number − 2451545
Get some additional parameters
lon  = longitude/360     as a fraction of circle
tz  = time_zone/24     as a fraction of circle
Then, the local sidereal time in seconds is found from
s  = 24110.5 + 8640184.812999999·jd/36525 + 86636.6·tz + 86400·lon
Convert to modulo radians
s  = s/86400     seconds to rotations
s  = s − floor(s)     as fraction of circle
lst  = 2·π·s     local sidereal time in radians

The Julian Day Number (JD) is the time measured in units of days that have elapsed since 12 hours, January 1, 4713 BCE (in the Julian calendar) or November 24, −4713, 12:00:00 UTC in the Gregorian calendar extended backward in time.

The Julian Day Number is named for Julius Scaliger, the father of Josephus Justus Scaliger, who invented the concept (not Julius Ceasar). Scaliger chose the particular date in the remote past because it was before recorded history and because in that year, three important cycles coincided with their first year of the cycle. These were the 19-year Metonic Cycle, the 15-year Indiction Cycle (a Roman Taxation Cycle) and the 28-year Solar Cycle (the length of time for the old Julian Calendar to repeat exactly).


  1. Astronomical Algorithms, Meeus

Return to Contents

Share | home | contents | send comment | send link | add bookmark |

Copyright © 2004, Stephen R. Schmitt