comp.lang.ada
 help / color / mirror / Atom feed
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: Re: Ada Calendar oddity <was Re: C date package>
Date: 2000/05/10
Date: 2000-05-10T00:00:00+00:00	[thread overview]
Message-ID: <3919862C.7870D7D8@earthlink.net> (raw)
In-Reply-To: slrn8his06.is.randhol+nospam@kiuk0156.chembio.ntnu.no



Preben Randhol wrote:

> -- snip
> >If I were designing such a package, I would think about the number of
> >bits needed to represent the number of seconds (or nanoseconds?) in the
> >range.
>
> I think that in this case one needs to use another type for the birth
> and expiration date and convert from Ada.Calendar the date of today if one
> also wants the date when the license was issued.
>
> --
> Preben Randhol -- [randhol@pvv.org] -- <http://www.pvv.org/~randhol/>
>          "Det eneste trygge stedet i verden er inne i en fortelling."
>                                                       -- Athol Fugard

It seems to me that it is a mistake to include seconds, much less any smaller
unit, in the calendar date.  I'm not sure that minutes is justified, but if
one uses a 64 bit number then it wouldn't seem to cause any problems.
(Calendar corrections for seconds are SO much more common than corrections for
minutes!)  2^63 minutes would seem to express any particular time that one
would want to talk about.
Perhaps Calendar and Time could be two separate packages, each using a 64-bit
number as their base, one based on days and the other based on
?nano?-seconds.  Or time could be defined with the top 32 bits being
equivalent to the bottom 32 bits of Calendar, and the "lower" 32 bits being a
floating point number guaranteed to be less than 1, a fractional number of
minutes.  This would allow DateTime to be a 96 bit number good for (nearly)
everything.  This would make formatting the I/O a bit of work, but would make
date and time calculations very simple.  It seems to me that one would gain on
one would more than make up for what one would loose on the other (I calculate
with Time-s a lot more than I display them).






  reply	other threads:[~2000-05-10  0:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <l0313030eb53d1408aee7@[144.205.16.58]>
2000-05-09  0:00 ` C date package Geoff Bull
2000-05-09  0:00   ` Geoff Bull
2000-05-09  0:00     ` Robert Dewar
2000-05-10  0:00       ` Geoff Bull
2000-05-10  0:00         ` Robert Dewar
2000-05-10  0:00           ` Ada Calendar oddity <was Re: C date package> Preben Randhol
2000-05-10  0:00             ` Robert A Duff
2000-05-10  0:00               ` Preben Randhol
2000-05-10  0:00                 ` Charles Hixson [this message]
2000-05-11  0:00                   ` Geoff Bull
2000-05-11  0:00                     ` Charles Hixson
2000-05-12  0:00                       ` Geoff Bull
2000-05-17  0:00               ` Robert I. Eachus
2000-05-19  0:00                 ` Geoff Bull
2000-05-19  0:00                   ` Robert I. Eachus
2000-05-21  0:00                     ` Robert Dewar
2000-05-21  0:00                   ` Robert Dewar
     [not found]                     ` <392869F0.D88F056A@acenet.com.au>
2000-05-22  0:00                       ` Tarjei Tj�stheim Jensen
2000-05-27  0:00                         ` Reinert Korsnes
2000-05-27  0:00                           ` Tarjei Tj�stheim Jensen
2000-06-03  0:00                       ` Robert I. Eachus
2000-05-10  0:00             ` Tarjei Tj�stheim Jensen
2000-05-11  0:00               ` Charles Hixson
2000-05-11  0:00                 ` Tarjei Tj�stheim Jensen
2000-05-12  0:00                   ` Charles Hixson
2000-05-12  0:00                     ` Tarjei Tj�stheim Jensen
2000-05-11  0:00               ` Geoff Bull
2000-05-11  0:00                 ` Gautier
2000-05-12  0:00                   ` Geoff Bull
2000-05-12  0:00                     ` Gautier
2000-05-11  0:00                       ` Al Christians
2000-05-10  0:00           ` C date package Geoff Bull
2000-05-10  0:00           ` Ken Garlington
2000-05-10  0:00             ` Geoff Bull
replies disabled

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