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: 103376,75c440b4b7ed5f91 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!news.tiscali.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Real Time IO routines Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1193410739.367181.96050@50g2000hsm.googlegroups.com> Date: Sat, 27 Oct 2007 12:18:39 +0200 Message-ID: NNTP-Posting-Date: 27 Oct 2007 12:18:39 CEST NNTP-Posting-Host: 35fcc69d.newsspool3.arcor-online.net X-Trace: DXC=cj`^c[WC@cgUoRk[hk2WalMcF=Q^Z^V3h4Fo<]lROoRa4nDHegD_]ReRGAbI?Q;i4fDNcfSJ;bb[eIRnRBaCd On Sat, 27 Oct 2007 08:56:42 GMT, anon wrote: > function To_Duration is new Ada.Unchecked_Conversion ( Time, Duration ) ; That is a bad idea. You don't know what is the internal representation of Time. The intended effect can be achieved legally: with Ada.Real_Time; use Ada.Real_Time; with Ada.Text_IO; use Ada.Text_IO; procedure Test is function Image (T : Time) return String is Seconds : Seconds_Count; Fraction : Time_Span; begin Split (T, Seconds, Fraction); declare After : constant String := Duration'Image (To_Duration (Fraction)); begin return Seconds_Count'Image (Seconds) & After (2..After'Last); end; end Image; begin delay 0.5; Put_Line (Image (Clock) & "s since the epoch"); delay 0.5; Put_Line (Image (Clock) & "s since the epoch"); end Test; -------------------- However it is quite useless to output absolute time values involving an unknown epoch. Unfortunately there is no portable way I know of to convert Real_Time.Time to UTC. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de