Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7457877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:22:42+00:00 2026-05-29T13:22:42+00:00

I am trying to get the same Created, Accessed and Modified dates as appears

  • 0

I am trying to get the same Created, Accessed and Modified dates as appears in the windows properties as in:

File Properties

But am finding the times are consistently 30 minutes out:

File Properties Delphi

Believe it may have something to do with timezones/daylight savings but have been unable to find a solution. Have tried looking at:
TimeZone Bias and adjusting and looking at different methods including:
How to get create/last modified dates of a file in Delphi?

Current code:

var
MyFd TWin32FindData;
FName: string;
MyTime: TFileTime;
MySysTime: TSystemTime;
myDate, CreateTime, AccessTime, ModTime: TDateTime; 
Begin
 ...
 FindFirstFile(PChar(FName), MyFd);
 MyTime:=MyFd.ftCreationTime;
 FileTimeToSystemTime(MyTime, MySysTime);
 myDate := EncodeDateTime(MySysTime.wYear, MySysTime.wMonth, MySysTime.wDay, MySysTime.wHour,
 MySysTime.wMinute, MySysTime.wSecond, MySysTime.wMilliseconds);
 Memo1.Lines.Add('Created: '+ FormatDateTime('dddd, d mmmm yyyy, hh:mm:ss ampm', MyDate));
 ...

Any help appreciated

Thanks
Paul

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:22:42+00:00Added an answer on May 29, 2026 at 1:22 pm

    I’m not sure what’s wrong with your current code, but I believe this code will do what you need, using standard Windows API calls.

    procedure TMyForm.ReportFileTimes(const FileName: string);
    
      procedure ReportTime(const Name: string; const FileTime: TFileTime);
      var
        SystemTime, LocalTime: TSystemTime;
      begin
        if not FileTimeToSystemTime(FileTime, SystemTime) then
          RaiseLastOSError;
        if not SystemTimeToTzSpecificLocalTime(nil, SystemTime, LocalTime) then
          RaiseLastOSError;
        Memo1.Lines.Add(Name + ': ' + DateTimeToStr(SystemTimeToDateTime(LocalTime)));
      end;
    
    var
      fad: TWin32FileAttributeData;
    
    begin
      if not GetFileAttributesEx(PChar(FileName), GetFileExInfoStandard, @fad) then
        RaiseLastOSError;
      Memo1.Clear;
      Memo1.Lines.Add(FileName);
      ReportTime('Created', fad.ftCreationTime);
      ReportTime('Modified', fad.ftLastWriteTime);
      ReportTime('Accessed', fad.ftLastAccessTime);
    end;
    
    procedure TMyForm.Button1Click(Sender: TObject);
    begin
      ReportFileTimes(Edit1.Text);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get Thin working with Bundle on Windows, I know, major PITA but
I'm trying to get a button which looks exactly the same whether it is
I'm trying to get it to verify that it has the same item in
I'm trying to get the def wfsc_pod1 and wfsc_ip into the same def. I'm
Trying to get an ASP application deployed; it worked for a while but then
I'm trying to get my current program to take information from a dynamically created
I'm trying to get ghostscript to render a pdf file from a Windows box.
I'm trying to get familiar with Android and its database API. I've created a
I'm trying to get both accelerometer and orientation data. Currently, I created an AccelerometerManager
I'm trying to get access to a Javascript API, I created, on other sites.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.