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

  • SEARCH
  • Home
  • 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 9060455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:14:04+00:00 2026-06-16T15:14:04+00:00

I have a problem getting file modified time as julian date. My Delphi 2010

  • 0

I have a problem getting file modified time as julian date. My Delphi 2010 looks like this:

AHandle := FindFirstFile(PChar('C:\*'), FindData);
if (AHandle <> INVALID_HANDLE_VALUE) then
begin
     repeat
           if (FindData.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY = 0) then
                ModifJulianDate := FileTimeToJulianDate(FindData.ftLastWriteTime);

     until Not FindNextFile(AHandle, FindData);
end;

The problem is: FileTimeToJulianDate() returned result has one hour offset, ie. if the file’s modified time is 10:01, this code returns 9:01!!

How can I fix this?

  • 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-06-16T15:14:06+00:00Added an answer on June 16, 2026 at 3:14 pm

    The functionality that you are looking for, assuming your answer is accurate, is most easily implemented using FileTimeToLocalFileTime.

    function UTCFileTimeToLocalDateTime(const UTCFileTime: TFileTime): TDateTime;
    var
      LocalFileTime: TFileTime;
      LocalSystemTime: TSystemTime;
    begin
      if not FileTimeToLocalFileTime(UTCFileTime, LocalFileTime) then
        RaiseLastOSError;
      if not FileTimeToSystemTime(LocalFileTime, LocalSystemTime) then
        RaiseLastOSError;
      Result := SystemTimeToDateTime(LocalSystemTime);
    end;
    

    Or if you prefer to use SystemTimeToTzSpecificLocalTime then do so like this:

    function UTCFileTimeToLocalDateTime(const UTCFileTime: TFileTime): TDateTime;
    var
      UTCSystemTime, LocalSystemTime: TSystemTime;
    begin
      if not FileTimeToSystemTime(UTCFileTime, UTCSystemTime) then
        RaiseLastOSError;
      if not SystemTimeToTzSpecificLocalTime(nil, UTCSystemTime, LocalSystemTime) then
        RaiseLastOSError;
      Result := SystemTimeToDateTime(LocalSystemTime);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem getting a java.io.File from the selection of a JFileChooser to
I have a problem with getting a class from an external .jar file. I
i am getting problem as i have some data in a database tabel file
I have this problem getting my newly created php project on Netbeans work on
I have a problem. file_get_contents and other file functions (like file, fopen, glob etc)
Since java does not support multiple inheritance I have a problem getting this to
I have a problem getting my layout.cshtml to have a dynamically chosen CSS file
I have a problem getting localized value (a UTF-8 string) from the properties file.
Ever since deleting the original settings.settings file I have had endless problems getting the
I just started a graphical C++ course and I have problem getting an overview

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.