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-Thread: 103376,cb2591a9113d8ee6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!hwmnpeer01.lga!hwmedia!news-server.columbus.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!tornado.socal.rr.com.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Advice on Calendar.Time References: <1131465873.702910.143400@g43g2000cwa.googlegroups.com> From: Keith Thompson Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:AjiyFjhWBS1L/2BZCKmugY4lvXI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 13 Nov 2005 21:37:35 GMT NNTP-Posting-Host: 66.75.136.120 X-Complaints-To: abuse@rr.com X-Trace: tornado.socal.rr.com 1131917855 66.75.136.120 (Sun, 13 Nov 2005 13:37:35 PST) NNTP-Posting-Date: Sun, 13 Nov 2005 13:37:35 PST Organization: Road Runner High Speed Online http://www.rr.com Xref: g2news1.google.com comp.lang.ada:6362 Date: 2005-11-13T21:37:35+00:00 List-Id: Jacob Sparre Andersen 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 San Diego Supercomputer Center <*> We must do something. This is something. Therefore, we must do this.