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!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada.Calendar.Time_Zones Date: Fri, 8 Aug 2008 21:09:42 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1rm26vi0mz4sv.1kfhdnswhcrqa.dlg@40tude.net> <3jxnfgd6m2ff.ca8crnn387m3.dlg@40tude.net> <61migfnkb0sm.8wytouvj8o4f.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1218249315 21290 69.95.181.76 (9 Aug 2008 02:35:15 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 9 Aug 2008 02:35:15 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Xref: g2news1.google.com comp.lang.ada:1573 Date: 2008-08-08T21:09:42-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:aht87sie2uac$.ke09vcui32dj.dlg@40tude.net... > On Thu, 7 Aug 2008 17:47:41 -0500, Randy Brukardt wrote: > >> "Dmitry A. Kazakov" wrote in message >> news:61migfnkb0sm.8wytouvj8o4f.dlg@40tude.net... >> ... >>> But all that stuff like Time_Of etc is not really needed with UTC_Time. >>> The package should provide Clock, +, -, <, <=, >, >=: >> >> I don't see how that could work. How would you display or create a UTC >> time? > > No problem: > > T : Ada.UTC_Time.Time := ...; > P : Ada.Calendar.Time := To_Calendar_Time (T); > > P is the political time corresponding to T, it is well-defined for each T. > P can be used in Ada.Calendar.Split to display T as: > > August 08, 2008 10:18 (Berlin time) > > When used in Ada.Calendar.Formatting.Split with > > Time_Zone => UTC_Time_Offset (T) > > the display could be: > > August 08, 2008 09:18 (UTC time) Sorry, this doesn't make any sense. Your original point, boiled down, is that it is never safe to convert from political time to UTC (because of the overlaps and holes). But then you go ahead and do exactly that. You could probably make it work if you somehow required Ada.Calendar.Time to store UTC time + a time zone converter (that is, it isn't really political time). But that would force a change in representation for most compiler's Ada.Calendar.Time type, and most likely an increase in size as well. That would really mess up existing programs that store binary representations of Time (as Janus/Ada does internally). In any case, if you were willing to require that, the current specification would work just fine for UTC time (because you could always get the UTC time directly from the record). In which case there is no problem, so we don't need an additional mechanism. ... >> Anyway, we should have this discussion on Ada-Comment, where it will get >> recorded and attached to the eventual AI on the topic. > > Has the proposal any chance to made it? I have no idea. I intend to put the mail and question into an AI and thus it will be on the agenda in the future. Beyond that I cannot say. I'm sure this exact proposal has no chance because it doesn't fix anything. But a proposal that does fix something may be a different animal. Randy.