comp.lang.ada
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
Subject: Re: Ada, calendar, and daylight savings
Date: Mon, 29 Oct 2001 03:44:04 GMT
Date: 2001-10-29T03:44:04+00:00	[thread overview]
Message-ID: <3BDCD0A9.5010101@acm.org> (raw)
In-Reply-To: nAPtT5l2SwNc@eisner.encompasserve.org

Larry Kilgallen wrote:

> In article <3BDC97CE.8070304@acm.org>, Corey Minyard <minyard@acm.org> 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




  reply	other threads:[~2001-10-29  3:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-28 23:41 Ada, calendar, and daylight savings Corey Minyard
2001-10-28 23:53 ` Larry Kilgallen
2001-10-29  3:44   ` Corey Minyard [this message]
2001-10-29 10:17     ` Larry Kilgallen
2001-10-29 14:02       ` Corey Minyard
2001-10-29 14:35     ` Marin David Condic
2001-10-29  2:34 ` Steven Deller
2001-10-29  3:51   ` tmoran
2001-10-29  5:53     ` Corey Minyard
2001-10-29  6:49       ` tmoran
2001-10-29 10:21       ` Larry Kilgallen
2001-10-29 14:18         ` Corey Minyard
2001-10-29 23:15           ` tmoran
2001-10-30  2:07             ` Corey Minyard
2001-10-30  3:11               ` tmoran
2001-11-01  0:13                 ` Al Christians
2001-10-30 12:29               ` Larry Kilgallen
2001-10-29 14:48       ` Marin David Condic
2001-10-29 17:41         ` Corey Minyard
2001-10-30  2:19           ` Nick Roberts
2001-10-30  5:41             ` Al Christians
replies disabled

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