comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada.Calendar.Time_Zones
Date: Fri, 8 Aug 2008 21:09:42 -0500
Date: 2008-08-08T21:09:42-05:00	[thread overview]
Message-ID: <g7ivp3$kpa$1@jacob-sparre.dk> (raw)
In-Reply-To: aht87sie2uac$.ke09vcui32dj.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:aht87sie2uac$.ke09vcui32dj.dlg@40tude.net...
> On Thu, 7 Aug 2008 17:47:41 -0500, Randy Brukardt wrote:
>
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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.





  reply	other threads:[~2008-08-09  2:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04  9:31 Ada.Calendar.Time_Zones Dmitry A. Kazakov
2008-08-04 13:56 ` Ada.Calendar.Time_Zones google1
2008-08-04 14:57   ` Ada.Calendar.Time_Zones Dmitry A. Kazakov
2008-08-04 20:56     ` Ada.Calendar.Time_Zones Maciej Sobczak
2008-08-04 22:12 ` Ada.Calendar.Time_Zones Randy Brukardt
2008-08-05  9:10   ` Ada.Calendar.Time_Zones Dmitry A. Kazakov
2008-08-07  2:52     ` Ada.Calendar.Time_Zones Randy Brukardt
2008-08-07  8:27       ` Ada.Calendar.Time_Zones Dmitry A. Kazakov
2008-08-07 22:47         ` Ada.Calendar.Time_Zones Randy Brukardt
2008-08-08  8:48           ` Ada.Calendar.Time_Zones Dmitry A. Kazakov
2008-08-09  2:09             ` Randy Brukardt [this message]
2008-08-09  8:04               ` Ada.Calendar.Time_Zones Dmitry A. Kazakov
2008-08-14  0:20                 ` Ada.Calendar.Time_Zones 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