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,aa60d56d22a287d1 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j8g2000yql.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Newbie Q: How to program in UTC (time/calendar) ? Date: Tue, 24 Mar 2009 03:07:12 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <89277c47-788d-441c-95b2-f47e1b70a532@j39g2000yqn.googlegroups.com> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1237889232 26486 127.0.0.1 (24 Mar 2009 10:07:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Mar 2009 10:07:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j8g2000yql.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5222 Date: 2009-03-24T03:07:12-07:00 List-Id: On 24 Mar, 08:51, reinkor wrote: > What is the "natural"/best way to make an Ada program > treat time/calendar data in UTC ? =A0The quetion is about > treating old measurements/data tagged with UTC time. > > I use > > =A0 Offset : Constant Time_Offset :=3D UTC_Time_Offset; > > and include "Time_Zone=3D>Offset" in calendar routines > (for example in the functions Time_Of, Split, Value > within =A0the packages Ada.Calendar.Formatting and > Ada.Calendar.Time_Zones). > > I find this a but "artificial". How should one do it? > > reinert Dmitry raises some issue which I'm sure the ARG are looking at but you _might_ be perfectly ok if all you're doing reading log files, etc and not actually trying to combine this with a clock your program is reading and expecting them to tie together with the time on your wrist watch. And if your log didn't come from a run over summer-time changes, leap seconds etc on an OS that actually dealt with such things. Cheers -- Martin