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,d1f23f0bd3971bec X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 29 Apr 2005 15:50:21 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1114090119.383842.20950@l41g2000cwc.googlegroups.com> <1KydnfadqcK30fXfRVn-qw@comcast.com> <10m95m5yelieq$.kj1rktb792s3.dlg@40tude.net> Subject: Re: Timing Block of GNAT code in milliseconds Date: Fri, 29 Apr 2005 15:52:55 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-oSUmjF5v23d5rO3a3pbGSFR2Yykaz37O3tlyHzoHZu31wOufYtny4ekBqRO5Yqt6Ie32M2bY8Afpstm!IH/gry8IbhGJ0PkMcGD+sIL+arGalbqFrKLwycRX8EvgLVEY/xygB6tm4uV6U2ymFVI+YgeT0g2x X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:10837 Date: 2005-04-29T15:52:55-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:10m95m5yelieq$.kj1rktb792s3.dlg@40tude.net... ... > We need time stamps synchronized across the network. The accuracy of > synchronization is the second problem. The first problem is that the very > idea of synchronized time stamps cannot be expressed in Ada terms. There is > no portable way to get say UTC from either Calendar or Real_Time, or to > convert UTC to them. Of course there is (assuming that you have a compiler that supports the Ada 2006 Ada.Calendar.Time_Zone and Ada.Calendar.Formatting.Split packages). declare Now : Ada.Calendar.Time := Ada.Calendar.Clock; UTC_Offset : Ada.Calendar.Time_Zones.Time_Offset := Ada.Calendar.Time_Zones.UTC_Time_Offset (Now); begin Ada.Calendar.Formatting.Split (Now, Time_Zone => UTC_Offset, ); ... end; It's a bit clunky, but that is the price of undoing daylight savings time. If your time period is short enough (doesn't cross any hour boundaries in the early morning), you can just get the offset once. And you can use Time_Of with a Time_Zone parameter to construct a value. Randy.