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,bba7760fccef922d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-03 08:13:31 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!intgwpad.nntp.telstra.net!nsw.nnrp.telstra.net!not-for-mail Message-ID: <3B426E83.D165100D@mullum.com.au> From: Charles Darcy X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-20mdk i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada.Calendar."+" gives peculiar result (Gnat 3.13) References: <3B428DB5.89E1D528@mullum.com.au> <3B41CC36.F7784960@cfmu.eurocontrol.int> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 04 Jul 2001 01:16:51 +0000 NNTP-Posting-Host: 203.109.169.87 X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 994173203 203.109.169.87 (Wed, 04 Jul 2001 01:13:23 EST) NNTP-Posting-Date: Wed, 04 Jul 2001 01:13:23 EST Organization: Customer of Telstra Big Pond Direct Xref: archiver1.google.com comp.lang.ada:9381 Date: 2001-07-04T01:16:51+00:00 List-Id: Ian Wild wrote: > > Charles Darcy wrote: > > > > Hello, > > > > I've been using the Ada.Calendar.Time type to represent dates in my > > program, and have struck a problem. > > > > Within a loop, I add (7 * Ada.Calendar.Day_Duration'Last) to an > > Ada.Calendar.Time object, at the end of each iteration. I expected this > > to advance the time by 1 week, and so it does initially. After a number > > of loop iterations, however, the addition seems to advance the time by 1 > > week and 1 hour. > > Daylight savings time? Yes, the problem seems related to Daylight Savings Time. The dates on which the extra hour appears and disappears, correspond to DST begin/end dates. > > Odd thing is, it seems to be using US rules, and > you're posting from .au, so I'd've expected the > anomalies to happen in the opposite order. I've just checked the Linux system time zone and found it set to Abidjan, Africa. I set the correct zone (NSW, Australia), re-run the test, and found that the additional hour has disappeared altogether. The time now advances one week exactly, irrespective of whether daylight savings time is in effect.