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: a07f3367d7,59c3b3f9911c9191 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.162 with SMTP id wj2mr403869pbc.2.1343314946361; Thu, 26 Jul 2012 08:02:26 -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!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada.Calendar and NTP (and Unix Epoch) Date: Tue, 24 Jul 2012 12:34:49 +0100 Organization: A noiseless patient Spider Message-ID: References: <500dc548$0$2936$f40e02c5@shockwave.dk.telia.net> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="8842a7d4de4576a1f051e50eba05301e"; logging-data="4266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kGkgeOiqXOn+e8wK46J4UK98u0bt/MS8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (darwin) Cancel-Lock: sha1:UtWzADdZz9WSFgBfpC5DURGCRCQ= sha1:u9UtsBCUTZy+SxCdg7f/APDdnwM= X-Received-Bytes: 1713 Content-Type: text/plain Date: 2012-07-24T12:34:49+01:00 List-Id: erlo writes: > This is because Ada.Calendar starts at 1-1-1901. But NTP starts at > 1-1-1900, so how can I work my way around this issue? I need to > compare NTP time with Unix Epoch based time. I did it by (effectively) working backward from the next NTP epoch (I treated NTP time as signed, so that the current NTP time is a negative number), which according to the code I have here[1] is 2036-02-07:06:28:16 (this should fit with Unix time, but I just used Ada). [1] http://coldframe.hg.sourceforge.net/hgweb/coldframe/adasntp/file/a6fd7b0dfeba/SNTP.impl/sntp_support.ads http://coldframe.hg.sourceforge.net/hgweb/coldframe/adasntp/file/a6fd7b0dfeba/SNTP.impl/sntp_support.adb