comp.lang.ada
 help / color / mirror / Atom feed
From: Mike Stark <michael.e.stark@gsfc.nasa.gov>
Subject: Re: Julian Dates package?
Date: 1997/01/06
Date: 1997-01-06T00:00:00+00:00	[thread overview]
Message-ID: <32D0CB2A.15EB@gsfc.nasa.gov> (raw)
In-Reply-To: 01bbfb55$c9dcbfe0$5e2d5c8b@jerryware


Jerry van Dijk wrote:
> 
> Jay Joiner <jjoiner@ibm.net> wrote in article
> <32CFFA13.5BF8@ibm.net>...
> 
> > I am interested in doing a Biorythm calculator in Ada and I need an
> Ada
> > package that can take the difference between two dates (birthdate and
> > today).

I suggest using package Calendar, since it provides subtraction operator
for two absolute times, yielding elapsed times.  To compute number of
days, create a birthdate and current date of type calendar.time, with
the seconds of day set to zero.  This will give you a (fixed point) 
number of seconds.  Divide that number by 86,400 and you now have
the number of days.

If you have any more questions, feel free to e-mail me.

> 
> I thought Julian dates were mainly used for astronomy and such ?
> 
> Jerry.

That is correct.  However, in the systems we use at Goddard's Flight
Dynamics Division we model times as seconds from a fixed reference date.
With spacecraft it is important to include leap seconds, because each 
leap second you neglect can translate to 7 or 8 kilometers of along 
track error in your orbit computation.  I don't think leap seconds 
matter much for a biorhythms program, though ;)

Mike




  parent reply	other threads:[~1997-01-06  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-05  0:00 Julian Dates package? Jay Joiner
     [not found] ` <01bbfb55$c9dcbfe0$5e2d5c8b@jerryware>
1997-01-06  0:00   ` Mike Stark [this message]
1997-01-09  0:00   ` Gautier
1997-01-13  0:00     ` Michael & Amy Hartsough
1997-01-08  0:00 ` Fintan
1997-01-08  0:00 ` Keith Thompson
1997-01-08  0:00   ` Mike Stark
1997-01-08  0:00     ` Robert Dewar
1997-01-09  0:00 ` Mats Weber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox