[comp.os.msdos.programmer] Calculating Julian Time...

gardner@iccgcc.decnet.ab.com (12/03/90)

I am writing an accounting application which needs to calculate a specific
julian date and time...  I have scrambled through my manuals, magazines, 
old physics books to find an algorithm, but to no avail!  The only information
I could find was creating a julian date using MONTH, DAY and YEAR... without
any mention of a specific HOUR, MINUTE and SECOND on that date... Does anyone
have any suggestions (... or better yet ALGORITHMS)?  

				Thanks,
					Mike Gardner
					Summit Software Engineering

jscotti@lpl.arizona.edu (Jim Scotti x2717) (12/04/90)

In article <2226.2758fb1a@iccgcc.decnet.ab.com> gardner@iccgcc.decnet.ab.com writes:
>I am writing an accounting application which needs to calculate a specific
>julian date and time...  I have scrambled through my manuals, magazines, 
>old physics books to find an algorithm, but to no avail!  The only information
>I could find was creating a julian date using MONTH, DAY and YEAR... without
>any mention of a specific HOUR, MINUTE and SECOND on that date... Does anyone
>have any suggestions (... or better yet ALGORITHMS)?  
>
>				Thanks,
>					Mike Gardner
>					Summit Software Engineering

When calculating the julian date, the DAY should include the fraction of a
day computed by:

	DAY = Dayofmonth + (HOUR + MINUTE/60 + SECOND/3600)/24

The HOUR should be corrected to Universal Time before this calculation.
For example, the UT HOUR is MST+7hrs or EST+5hrs, etc.

The DAY could be stored to 5 decimals which would produce slightly better
than 1 second precision.

Julian dates start at 0.5 at 00:00:00 UT, so 12:00:00 UT is 1.0.   

I do not have any actual algorithms handy, but it sounds like you may have
found one which should be easy to implement.  If you need to test your
algorithm, 1990 Dec. 3, 21:30:15 (MST) is 1990 Dec. 4, 04:30:15 UT is julian
date 2448229.68767.

Jim.

pipkinsj@cpqhou.uucp (Jeff Pipkins @Adv Dev@SE hou ) (01/05/91)

>In article <2226.2758fb1a@iccgcc.decnet.ab.com> gardner@iccgcc.decnet.ab.com writes:
>I am writing an accounting application which needs to calculate a specific
>julian date and time...  I have scrambled through my manuals, magazines, 
>old physics books to find an algorithm, but to no avail!  The only information
>I could find was creating a julian date using MONTH, DAY and YEAR... without
>any mention of a specific HOUR, MINUTE and SECOND on that date... Does anyone
>have any suggestions (... or better yet ALGORITHMS)?  
>
>				Thanks,
>					Mike Gardner
>					Summit Software Engineering
>
Reference:
Meeus, Jean, 1982, _Astronomical_Formulae_for_Calculators_, Willmann-Bell pub.

-- 
Jeff D. Pipkins (uunet!cpqhou!pipkinsj)

My disclaimer: My opinions do not necessarily reflect those of my employer.
Papaw's disclaimer: I've already told you more than I know.