Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!uw-beaver!zephyr.ens.tek.com!master!saab!billr From: billr@saab.CNA.TEK.COM (Bill Randle) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: (Astronomical) Julian Date Source Wanted Message-ID: <1087@masterCNA.TEK.COM> Date: 16 Apr 91 21:16:08 GMT References: <9873.2808dac2@ohstpy.mps.ohio-state.edu> <40790007@hpcvra.cv.hp.com.> Sender: news@masterCNA.TEK.COM Reply-To: billr@saab.CNA.TEK.COM (Bill Randle) Organization: Tektronix, Inc., Redmond, OR Lines: 92 In article <40790007@hpcvra.cv.hp.com.> everett@hpcvra.cv.hp.com. (Everett Kaser) writes: >> everett@hpcvra.cv.hp.com. (Everett Kaser) writes: >>>Just out of curiousity, what's the difference between Astronomical and >>>USGovernment Julian dates? >> >>Strictly speaking the astronomical quantity is the Julian day number, >>which is the number of ephemieris days that have elapsed at the >>previous 12h ET since 12h ET on 1 Jan 4713 BCE. >> >I'm giving up, I'm SO confused. The original poster had mentioned USGov'mt >Julian days, which was what I was unfamiliar with. Now, you've confused >me about Julian days completely. I thought Julian days were measured from >sometime in the 1500's AD. I've never heard of 'BCE', and I have no idea >what happened 4713 years ago (or more) that 'BCE' years would be based on. Julian Day (named after the inventor's father Julius) number 1 started at 12 noon 1 Jan 4713 BC as previously mentioned. This date was picked as the most recent time (as of 1582 AD) when three major chronological cycles began on the same day: 1) 28-year solar cycle, 2) 19-year lunar cycle and 3) the 15-year indiction cycle (used in ancient Rome). The Julian calendar (which may be what the original poster refered to as the "USGov" dates) was the basis of our modern calendar and was authorized by Julius Caesar in 46 BC. It was based on the assumption of a fixed 365 1/4 days per year, which caused it to be off by about 10 days by the year 1582. Thus Pope Gregory XIII decreed that the day after 4 Oct 1582 should be 15 Oct 1582 and that century years (1600, 1700, etc.) should *not* be leap years unless they were divisible by 400. This new calendar is known as the Gregorian Calendar and is what we use today in most of the world. [The above information is from "The World Almanac and Book of Facts" (1988 ed.).] Now, to answer the original poster's question, here is some code to compute Julian Dates given Gregorian Dates. The first converts from day-month-year to Julian Day, the second from Unix time (seconds) to Julian Day. -Bill Randle Tektronix, Inc. billr@saab.CNA.TEK.COM --------------------------- /* this is from datelib.c, a part of calentool */ /* * julian_day: * Compute Julian day (>=1) * given day (1-31), month (1-12), year (1901-2009) * * Notes: The Gregorian reform is taken into account (that is, the day * following 4 October 1582 is 15 October 1582; dates on this latter day or * later are said to be in the Gregorian calendar). B.C. years are counted * astronomically (the year prior to year 1 is year 0). The Julian day * begins at GMT noon (the day is expressed in floating point). * Example: to obtain Julian day for 4 Jul 1979: julian_day(4.0, 7, 1979) */ double julian_day(day, month, year) double day; int month, year; { int atmp, monthp, yearp; double ctmp = 1720994.5 + day; if (month > 2) { monthp = month + 1; yearp = year; } else { monthp = month + 13; yearp = year - 1; } if ((year > 1582) || (year == 1582 && month >= 10) || (year == 1582 && month == 10 && day >= 15)) { atmp = year / 100; ctmp += 2 - atmp + (int)(atmp / 4); } ctmp += (int)(365.25 * yearp) + (int)(30.6001 * monthp); return ctmp; } /* this is from riseset.c, a part of calentool */ /* * compute Julian day given Unix time (i.e. seconds past 1 Jan 1970) */ #define Sec_per_day 86400L #define J1970 40587.5 double julian_day_u(t) long t; { return (t/Sec_per_day) + (double)(t % Sec_per_day)/Sec_per_day + J1970; }