comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Biggar <mark.a.biggar@attbi.com>
Subject: Re: Timetype
Date: Fri, 28 Jun 2002 05:26:07 GMT
Date: 2002-06-28T05:26:07+00:00	[thread overview]
Message-ID: <3D1BF397.CC974E8E@attbi.com> (raw)
In-Reply-To: 7CKS8.3774$t4.9720@nntpserver.swip.net

Bj�rn Lundin wrote:
> 
> Hello1
> Can anyone explain this to me?
> 
> cut from a-calend.ads
> --  Declarations representing limits of allowed local time values. Note that
> --  these do NOT constrain the possible stored values of time which may well
> --  permit a larger range of times (this is explicitly allowed in Ada 95).
> 
>    subtype Year_Number  is Integer range 1901 .. 2099;
> 
> Does it mean that i can write an application dealing with historical dates
> using the time_type?
> 
> It seems to me that a date like 05-Jun-1712 would cause
> constraint_error.
> 
> Does anyone know the reason for this small range of years in
> the timetype?

Yes, this range allows using the expression (year mod 4 = 0) to test
test for leap years. BTW taking your example date, which one do you
mean?  There is a 11 day difference between 05-jun-1712 in England and 
its colonies and that date in most of Europe.  England didn't convert
to the Gregorian calendar until 1752, while most of Catholic europe
converted in the 1500's.  Russia didn't convert until the 1920's, so
even Ada's year range can cause problems with historical dates. The
standard writers didn't want to deal with the mess that the calendar 
is in.

--
Mark Biggar
mark.a.biggar@attbi.com



  parent reply	other threads:[~2002-06-28  5:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-27 20:31 Timetype Björn Lundin
2002-06-27 21:03 ` Timetype David C. Hoos
2002-06-28  5:26 ` Mark Biggar [this message]
2002-06-28 13:47   ` Timetype Marin David Condic
2002-06-28 17:12   ` Timetype Björn Lundin
2002-06-28 23:51   ` Timetype Robert C. Leif
2002-06-28 12:53 ` Timetype Jacob Sparre Andersen
replies disabled

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