From mboxrd@z Thu Jan 1 00:00:00 1970 X-Received: by 2002:ac8:6602:0:b0:412:8bb7:25a6 with SMTP id c2-20020ac86602000000b004128bb725a6mr44036qtp.4.1697551994523; Tue, 17 Oct 2023 07:13:14 -0700 (PDT) X-Received: by 2002:a05:6870:219c:b0:1e9:8db0:383 with SMTP id l28-20020a056870219c00b001e98db00383mr979545oae.1.1697551994243; Tue, 17 Oct 2023 07:13:14 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!xmission!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 17 Oct 2023 07:13:13 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2601:188:ca01:c10:5590:bf9a:af40:f24d; posting-account=1tLBmgoAAAAfy5sC3GUezzrpVNronPA- NNTP-Posting-Host: 2601:188:ca01:c10:5590:bf9a:af40:f24d References: <262bea8c-57ff-480e-b5aa-da94f0436e98n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <04b87486-0614-4775-a40f-66138d08058an@googlegroups.com> Subject: Re: Windows file timestamp converted to local time From: Matt Borchers Injection-Date: Tue, 17 Oct 2023 14:13:14 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2700 Xref: news.eternal-september.org comp.lang.ada:65799 List-Id: On Monday, October 16, 2023 at 2:49:52=E2=80=AFPM UTC-4, Niklas Holsti wrot= e: > On 2023-10-16 21:35, Matt Borchers wrote:=20 > > Below is the function from System.OS_Lib.=20 > > Does anybody know where the C implementation can be found?=20 > > Does anybody know where the C implementation of "localtime" is found?= =20 > >=20 > > function File_Time_Stamp (Name : C_File_Name) return OS_Time is=20 > > function File_Time (Name : Address) return OS_Time;=20 > > pragma Import (C, File_Time, "__gnat_file_time_name");=20 > > begin=20 > > return File_Time (Name);=20 > > end File_Time_Stamp; > (This question seems to be a follow-up ("Re:") to some earlier post, but= =20 > my newsreader does not seem to find or show that earlier post.)=20 >=20 > What is the problem?=20 >=20 > Have you tried using the standard Ada services:=20 > Ada.Directories.Modification_Time and=20 > Ada.Calendar.Time_Zones.Local_Time_Offset? Thank you for the suggestion of using "Ada.Directories.Modification_Time". = I didn't think to look in that package. This function adjusts for daylight = savings time and returns the time as displayed in Windows Explorer. There needs to be better comments (and documentation) for these time relate= d functions. It is often not clear what time is returned. It is safe to ass= ume UTC or local time, but the daylight savings issue caused confusion.