comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Advice on Calendar.Time
Date: Sun, 13 Nov 2005 21:37:35 GMT
Date: 2005-11-13T21:37:35+00:00	[thread overview]
Message-ID: <ln8xvsqlep.fsf@nuthaus.mib.org> (raw)
In-Reply-To: m2slu0prai.fsf@hugin.crs4.it

Jacob Sparre Andersen <sparre@nbi.dk> writes:
> Keith Thompson wrote:
>> That might be acceptable for an embedded system.  If it's a
>> user-oriented OS (like, say, Unix or Windows), making the system
>> clock incorrect by an hour for half of each year would be a very bad
>> idea.
>
> Unix systems (at least those I have used) do actually by default run
> the system clock on UTC without fiddling around with the hours twice a
> year.  It is only the time shown to the users which is changed
> (depending on where in the world they claim to be located).

Right, and the Unix approach is, IMHO, exactly the right one (ignoring
any leap-second issues).  The problem is that Ada.Calendar on
Unix-like systems typically uses local time, i.e., the system UTC
clock adjusted by any system-defined or user-defined time zone offset,
with no mechanism for going back to the underlying UTC time.

(I'm amplifying on what you wrote, not disagreeing with it.)

>> On some systems, time zone information has a default system-wide
>> value, but can be changed for individual processes.  Setting the $TZ
>> environment variable to "UTC" certainly isn't portable, but it might
>> be good enough for the OP's purposes.
>
> Fixing the Ada.Calendar system so you can request both UTC and "user
> time" would be the right solution.  I hope this is done in Ada2005.

I believe there are proposals to do just that.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.



  reply	other threads:[~2005-11-13 21:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-08 16:04 Advice on Calendar.Time REH
2005-11-08 17:09 ` Larry Kilgallen
2005-11-08 17:30   ` REH
2005-11-08 17:59   ` Wilhelm Spickermann
2005-11-08 18:38     ` REH
2005-11-08 19:29       ` Martin Dowie
2005-11-08 20:05         ` REH
2005-11-08 22:00           ` Martin Dowie
2005-11-08 23:02             ` REH
2005-11-08 22:09           ` Wilhelm Spickermann
2005-11-08 22:13             ` REH
2005-11-09  5:23               ` Wilhelm Spickermann
2005-11-09  7:00               ` Martin Dowie
2005-11-09  3:16       ` Jeffrey R. Carter
2005-11-09  1:36   ` Keith Thompson
2005-11-13 14:15     ` Jacob Sparre Andersen
2005-11-13 21:37       ` Keith Thompson [this message]
2005-11-09  0:23 ` Stephen Leake
2005-11-09  8:32 ` Dmitry A. Kazakov
2005-11-09 19:37 ` brian.b.mcguinness
2005-11-09 21:45   ` brian.b.mcguinness
2005-12-01  0:24   ` Randy Brukardt
replies disabled

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