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,335675a1cb969fdb X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!2g2000hsn.googlegroups.com!not-for-mail From: google1@hafdconsulting.com Newsgroups: comp.lang.ada Subject: Re: Ada.Calendar.Time_Zones Date: Mon, 4 Aug 2008 06:56:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1rm26vi0mz4sv.1kfhdnswhcrqa.dlg@40tude.net> NNTP-Posting-Host: 68.20.35.30 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1217858216 16290 127.0.0.1 (4 Aug 2008 13:56:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 4 Aug 2008 13:56:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 2g2000hsn.googlegroups.com; posting-host=68.20.35.30; posting-account=OhyMIwoAAABpudocR3HA8t2ohhQMuzpv User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux sparc64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.8-1),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1433 Date: 2008-08-04T06:56:56-07:00 List-Id: On Aug 4, 4:31 am, "Dmitry A. Kazakov" wrote: > Does anybody know the meaning of the result returned by UTC_Time_Offset? RM > says: > > "Returns, as a number of minutes, the difference between the > implementation-defined time zone of Calendar, and UTC time, at the time > Date." > > This is ill-defined. Political time has overlapping intervals in presence > of daylight saving time, when the clock is adjusted backwards. That definition accounts for DST shifts. It says "at the time Date," which means that if the date falls into a period where the locale is in a DST shift, it will return the DST offset. Otherwise, it will return the ST offset. Unix systems keep information about historic and future (planned) shifts in their locale's time offset in the tzdata database. I suspect Windows and other systems have something similar, so by using that database it is possible to find the time offset for any point in the past, as well as predicted ones for points in the future. > The overlapping time interval has two differences to the UTC time. So which > one is returned by UTC_Time_Offset? > > Furthermore, some intervals are missing in political time. That is when the > clock is adjusted forward. What is the difference then? Unknown_Zone_Error? I'm not aware of what is typically done in such areas. I would suspect that each differing opinion has its own locale, and the computer will be configured to use one locale or the other. > P.S. Why not to simply provide Ada.UTC_Time (with conversion to > Ada.Calendar.Time) instead of this mess? Well I don't think it's a mess. You can convert to UTC or any other timezone very easily by changing the offset. Most internet communication deals in dates via a UTC offset (typically in the form +/-HHMM but it's easy to convert from that to +/-minutes). I can say that dealing with date stamps in the Basil project would have been *far* more difficult using Ada 95 dates, which are ignorant of differing timezones.