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,2b151131f90050ab X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-28 19:44:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!newshub2.rdc1.sfba.home.com!news.home.com!news2.rdc2.tx.home.com.POSTED!not-for-mail Message-ID: <3BDCD0A9.5010101@acm.org> From: Corey Minyard User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:0.9.5+) Gecko/20011012 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada, calendar, and daylight savings References: <3BDC97CE.8070304@acm.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 29 Oct 2001 03:44:04 GMT NNTP-Posting-Host: 24.7.109.109 X-Complaints-To: abuse@home.net X-Trace: news2.rdc2.tx.home.com 1004327044 24.7.109.109 (Sun, 28 Oct 2001 19:44:04 PST) NNTP-Posting-Date: Sun, 28 Oct 2001 19:44:04 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15324 Date: 2001-10-29T03:44:04+00:00 List-Id: Larry Kilgallen wrote: > In article <3BDC97CE.8070304@acm.org>, Corey Minyard writes: > >>I've been looking at calendar issues in Ada, I'm trying to write a >>complete calendar package for Ada. I'm trying to understand how >>daylight savings works in Ada.Calendar. >> >>An average day has 86_400 seconds (24 * 3600). However, the day where >>daylight savings time is activated would seem to have 82_800 seconds (23 >>* 3600) and the day where daylight savings time is deactivated, as just >>happened in the US, would seem to have 90_000 seconds (25 * 3600). >> > > If you choose to reset your clock in response to legislative initiatives, > you should reset your Ada calendar as well. > > Daylight savings time is just a manipulation of a time zone, and time > zones are outside the Ada Calendar package, aren't they ? If only life were so simple. I'm actually fairly familiar with how time works, I was wondering if there was any standard besides the vague statements made in the RM, maybe something buried in the AARM that compiler vendors implemented. All systems that do a decent job handling time store the time in GMT and convert based upon timezone, DST, etc. This way, you can correctly determine everything about the time and handle it in a portable manner. Two basic problems I see with the way Ada time works: * DST will cause problems, because you cannot print the time and be 100% sure it is unambiguous. This is more of a problem than you might think when you have automated systems that take information and process it. Every once in a while you will get wierd glitches. * You cannot communicate using time with other systems, because you don't know if your local time is DST, what your GMT offset is, and thus you cannot determine what your local time really is or how to relate that to the time at another location. In other words, Ada.Calendar is not useful for operating in a geographically distributed heterogeneous system where you have to coordinate times. -Corey