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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,59c3b3f9911c9191 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.100.137 with SMTP id y9mr938577qan.2.1343316648088; Thu, 26 Jul 2012 08:30:48 -0700 (PDT) Received: by 10.66.77.3 with SMTP id o3mr1411037paw.13.1343314985086; Thu, 26 Jul 2012 08:03:05 -0700 (PDT) Path: a15ni113198934qag.0!nntp.google.com!q21no6412759qas.0!news-out.google.com!p10ni61947386pbh.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newspump.sol.net!xlned.com!feeder3.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!94.232.116.11.MISMATCH!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.straub-nv.de!news-1.dfn.de!news-2.dfn.de!news.dfn.de!feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada.Calendar and NTP (and Unix Epoch) Date: Tue, 24 Jul 2012 15:02:22 +0200 Organization: cbb software GmbH 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> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Received-Bytes: 2603 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-24T15:02:22+02:00 List-Id: On Tue, 24 Jul 2012 05:27:30 -0700 (PDT), erlo.haugen@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 Is it a standard Ada package? > 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. Take some other base, e.g. 01.01.2010 00:00 [UTC, GMT, CET ...], if you have an NTP reading of it. E.g. if NTP uses some astronomical year or other method to calculate difference between two times. You should not use Ada.Calendar without knowing exactly what time it represents on the given machine. >> This presumes that they represent *same* time though maybe using different >> epochs. You might need to read the UNIX and NTP documentation to learn what >> exactly times they do represent. That would give you E2 - E1. To put it >> simple: same time = synchronized clocks. > > This is the exact case. Which I doubt, but anyway. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de