From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Windows file timestamp converted to local time Date: Mon, 16 Oct 2023 21:39:09 -0500 Organization: A noiseless patient Spider Message-ID: References: <262bea8c-57ff-480e-b5aa-da94f0436e98n@googlegroups.com> Injection-Date: Tue, 17 Oct 2023 02:38:41 -0000 (UTC) Injection-Info: dont-email.me; posting-host="f60c9ad74c23009b0789f47cb2ded7c1"; logging-data="2850290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18oTDWAabrkEuozvX59vMDQXQjAP6ydzEI=" Cancel-Lock: sha1:TU/TxKHLEvvgHe4WPmbZwWv/hVc= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Response X-Priority: 3 X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MSMail-Priority: Normal Xref: news.eternal-september.org comp.lang.ada:65796 List-Id: "Niklas Holsti" wrote in message news:kp5eucFogqpU1@mid.individual.net... > On 2023-10-16 21:35, Matt Borchers wrote: >> Below is the function from System.OS_Lib. >> Does anybody know where the C implementation can be found? >> Does anybody know where the C implementation of "localtime" is found? >> >> function File_Time_Stamp (Name : C_File_Name) return OS_Time is >> function File_Time (Name : Address) return OS_Time; >> pragma Import (C, File_Time, "__gnat_file_time_name"); >> begin >> return File_Time (Name); >> end File_Time_Stamp; > > > (This question seems to be a follow-up ("Re:") to some earlier post, but > my newsreader does not seem to find or show that earlier post.) > > What is the problem? > > Have you tried using the standard Ada services: > Ada.Directories.Modification_Time and > Ada.Calendar.Time_Zones.Local_Time_Offset? ...as those will work on (almost) any target system, while the actual implementation is going to be rather OS-dependent. And there never is a good reason to use a GNAT-only (or any compiler-specific, for any compiler) facility when there is an equivalent standard facility. Most of those facilities pre-date the Ada ones. Randy.