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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7dadb26e573572d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-07 23:50:28 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tdcnorge.no!uninett.no!not-for-mail From: Reinert Korsnes Newsgroups: comp.lang.ada Subject: Re: ada calendar Date: Mon, 08 Dec 2003 08:49:29 +0100 Organization: UNINETT Message-ID: References: <4948f537.0312051300.d246254@posting.google.com> NNTP-Posting-Host: sthrkou.ffi.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: dolly.uninett.no 1070869826 16247 193.156.99.159 (8 Dec 2003 07:50:26 GMT) X-Complaints-To: news-abuse@uninett.no NNTP-Posting-Date: Mon, 8 Dec 2003 07:50:26 +0000 (UTC) User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:3218 Date: 2003-12-08T08:49:29+01:00 List-Id: Nick Roberts wrote: > Stephen Leake wrote: > >>>how can i add one week to clendar.time record using duration ? >> >> with Ada.Calendar; use Ada.Calendar; >> procedure One_Week >> is >> One_Minute : constant Duration := 60.0; >> One_Hour : constant Duration := 60 * One_Minute; >> One_Day : constant Duration := 24 * One_Hour; >> One_Week : constant Duration := 7 * One_Day; >> >> Now : Time := Clock; >> begin >> Now := Now + One_Week; >> end One_Week; > > This may work on some implementations. If it fails, the compiler should > issue a fatal error. In this case, Tom Moran's suggestion: > > One_Minute : constant Duration := 60.0; > One_Hour : constant Duration := 60 * One_Minute; > One_Day : constant Duration := 24 * One_Hour; > > Now : Time := Clock; > begin > for Day in 1 .. 7 loop > Now := Now + One_Day; > end loop; > > ought to work. There is a proposal to add this functionality in the next > revision of the language (AI-351). > Will this revision include definitions based on precise description of movements of the Earth ? The rotation of the Earth is not so well defined and if one wants very high precision - as one may want within some applications of theoretical (geo-)physics/astronomy - then I guess such calendar definitions cannot be implemented in a computer language ? The "Ada calender" will be more like the "official/standard calendar" - but this is subject to frequent modifications ? Or does there exist a stable calendar standard which everybody agree on ? reinert