comp.lang.ada
 help / color / mirror / Atom feed
From: google1@hafdconsulting.com
Subject: Re: Ada.Calendar.Time_Zones
Date: Mon, 4 Aug 2008 06:56:56 -0700 (PDT)
Date: 2008-08-04T06:56:56-07:00	[thread overview]
Message-ID: <ee7af051-9fa1-4b69-87db-9db1ea3acc3e@2g2000hsn.googlegroups.com> (raw)
In-Reply-To: 1rm26vi0mz4sv.1kfhdnswhcrqa.dlg@40tude.net

On Aug 4, 4:31 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
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.



  reply	other threads:[~2008-08-04 13:56 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 ` google1 [this message]
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             ` Ada.Calendar.Time_Zones Randy Brukardt
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