From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,6b85fea93f20b683 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-27 14:04:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Timetype Date: Thu, 27 Jun 2002 16:03:14 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <7CKS8.3774$t4.9720@nntpserver.swip.net> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: avanie.enst.fr 1025211842 17068 137.194.161.2 (27 Jun 2002 21:04:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Thu, 27 Jun 2002 21:04:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:26751 Date: 2002-06-27T16:03:14-05:00 ----- Original Message ----- From: "Bj�rn Lundin" Newsgroups: comp.lang.ada To: Sent: Thursday, June 27, 2002 3:31 PM Subject: Timetype > > 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? > Not exactly. The problem would be with the Split and Time_Of subprograms, not with the representation of values of type Time. > It seems to me that a date like 05-Jun-1712 would cause > constraint_error. That's correct, as far as the use of the aforementioned subprograms is concerned. > > Does anyone know the reason for this small range of years in > the timetype? The Year_Number range of 1901 .. 2099 was deliberately chosen so that implementations could use the simple rule that if (Year mod 4) = 0 then the year is a leap year. I.e., it does not have to deal with the more complex rule that is_Leap_Year := (Year mod 4) = 0 and then ((Year mod 100) /= 0 or else (Year mod 400) = 0); to say nothing about the dates on which various countries switched from the Julian to the Gegorian calendar. There is also the complication that on UNIX systems, the range of time representable in a 32-bit integer extends only from December 13, 1901 through January 18, 2038. > > /Bj�rn > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >