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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f3f07e9e53bcc4f6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-20 19:13:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!newsfeed.mathworks.com!wn3feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!rwcrnsc53.POSTED!not-for-mail From: "Steve Doiel" Newsgroups: comp.lang.ada References: <3c1f3917.16015859@News.CIS.DFN.DE> <3C2057AF.323DFF5C@icn.siemens.de> <3c208dc5.16968437@News.CIS.DFN.DE> <3c21f386.108560406@News.CIS.DFN.DE> Subject: Re: FILETIME <-> Ada.Real_Time.Time conversions X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: NNTP-Posting-Host: gkxU7-169322-NM4-3216108@rwcrnsc53 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1008904417 gkxU7-169322-NM4-3216108@rwcrnsc53 (Fri, 21 Dec 2001 03:13:37 GMT) NNTP-Posting-Date: Fri, 21 Dec 2001 03:13:37 GMT Organization: AT&T Broadband Date: Fri, 21 Dec 2001 03:13:37 GMT Xref: archiver1.google.com comp.lang.ada:18188 Date: 2001-12-21T03:13:37+00:00 List-Id: > >Also note: it may not be possible (read probably isn't) to represent all > >values of FILETIME as a Ada.Real_Time.Time value since the size of the > >values may differ. As I recall the resolution of time in Ada.Real_Time is > >not specified, but a minimum resolution and range is. > > We can definitely live with smaller range and/or precision. The real > problem is that there is no correlation between epoch of > Ada.Real_Time.Split and UTC. > > Regards, > Dmitry Kazakov Have you considered defining your own epoch in terms of both times? You can determine the FILETIME value for your epoch using SystemTimeToFileTime. I'll call this file_time_epoch. You only have to do this once, then you can define the value as a program constant. You can determine the Real_Time.Time value for your epoch using Ada.Calendar.Time_Of. I'll call this real_time_epoch. To obtain a Real_Time.Time value from a subsequent FILETIME values use: real_time_value := real_time_epoch + Ada.Real_Time.Nanoseconds( Integer( file_time_value - file_time_epoch ) ); I'm sure you'll have to mess with the types to get things working, but I think this will get you there. SteveD