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,59c3b3f9911c9191 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.129.81 with SMTP id n17mr4450839bks.3.1343147908532; Tue, 24 Jul 2012 09:38:28 -0700 (PDT) Path: m12ni20362bkm.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Ada.Calendar and NTP (and Unix Epoch) Date: Tue, 24 Jul 2012 09:37:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <500dc548$0$2936$f40e02c5@shockwave.dk.telia.net> <18893cca-baa2-4930-bfb4-4c4f7eb7e983@googlegroups.com> <5s8s08lv6dj1i4tkb99roq9roifsgr44vd@invalid.netcom.com> <1e0fmpgo1d8ke.7gc1rzrv8v72.dlg@40tude.net> <6f28df4c-6b1a-46d1-a3b9-9ae41ea975a2@googlegroups.com> <4l5t6lhzgquo$.qa4ud3ssphtd.dlg@40tude.net> <4b3daad0-b884-4f42-9aa5-891bcfeadf87@googlegroups.com> <221dd619-09dd-4d62-9a42-f967471c3d12@googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 X-Trace: posting.google.com 1343147908 31582 127.0.0.1 (24 Jul 2012 16:38:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Jul 2012 16:38:28 +0000 (UTC) In-Reply-To: <221dd619-09dd-4d62-9a42-f967471c3d12@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-07-24T09:37:07-07:00 List-Id: On Tuesday, July 24, 2012 5:27:30 AM UTC-7, erlo....@gmail.com wrote: > > Where is a problem then? > > > > E1 + T1 vs. E2 + T2 > > > > <=> > > > > T1 vs. (E2 - E1) + T2 > > > > Where E2 - E1 is the time offset between the epochs. > > That's true, the issue here is that I was fooled by Ada.Calendar.Conversion spec > into thinking that I can use To_Ada_Time to convert the NTP epoch base (1-1-1900 0:00) to a variable of type Time. This would make it easy to calculate > the offset between the two epochs: > epoch_diff := To_Ada_Time(70, 0, 1, 0, 0 ,0 0) - To_Ada_Time(00, 0, 1, 0, 0 ,0 0) If all you're trying to do is figure out the number of seconds between 1/1/1970 and 1/1/1900 by using an Ada Time type, you can do this easily by figuring out the number of seconds between 1/1/1970 and 1/1/1901, and adding a constant. -- Adam