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.66.83.73 with SMTP id o9mr1460026pay.2.1343314509471; Thu, 26 Jul 2012 07:55:09 -0700 (PDT) Path: 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!94.232.116.11.MISMATCH!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.straub-nv.de!news.swapon.de!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 11:13:42 +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> 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: 2991 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-24T11:13:42+02:00 List-Id: On Tue, 24 Jul 2012 01:34:03 -0700 (PDT), erlo.haugen@gmail.com wrote: >> Political time is one regulated by politicians, localized, daylight saving >> etc. Political time is unusable for the purpose of time stamping and clock >> synchronization, but of course indispensable for the UI. >> >> Ada.Calendar implicitly represents such a time. NTP, I only guess, because >> we are using other mechanisms of time distribution and synchronization, is >> not a political time. Is it UTC? >> >> Which is why I second to Adam asking what are going to achieve. > > I see. NTP is just the number of seconds Any time is just a number of seconds added to some epoch... > The purpose of this exercise is to compare two timestamps, one base on > Unix epoch and one based on NTP epoch. 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. 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. Note that if any of two times is political, E2 - E1 does not exist as it becomes a function of time. This where all starts really complicated and is the reason why one should never ever mess up with the political time for the purpose of time stamping. And this is just a relatively simple case when clocks are synchronized but one of them is periodically skewed. When clocks are not synchronized, time stamps are fundamentally incomparable without the history of synchronization, which, well, means that they were rather synchronized. (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de