Watch, Follow, &
Connect with Us
Public Report
Report From: EDN/Member services    [ Add a report in this area ]  
Report #:  121323   Status: Need Feedback
FileAge - There is one second difference in the deprecated version and the new one.
Project:  EDN Build #:  1
Version:    2 Submitted By:   Peter Wokke
Report Type:  Minor failure / Design problem Date Reported:  12/22/2013 11:06:43 AM
Severity:    Serious / Highly visible problem Last Updated: 12/22/2013 5:07:30 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Need More Info (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
FileAge - There is one second difference in the deprecated version and the new one.
Steps to Reproduce:
    procedure TMainForm.Button1Click(Sender: TObject);
    Var
      D : TDateTime;
    begin
      If OpenDialog1.Execute And
         FileAge(OpenDialog1.FileName, D) Then
        ShowMessage(Format('Old FileAge: %d' + #13#10 +
                           'New FileAge: %d',
                           [FileAge(OpenDialog1.FileName),
                            DateTimeToFileDate(D)]));
    end;
Workarounds
or

procedure TMainForm.Button1Click(Sender: TObject);
    Var
      D : TDateTime;
    begin
      If OpenDialog1.Execute And
         FileAge(OpenDialog1.FileName, D) Then
        ShowMessage(Format('Old FileAge: %s' + #13#10 +
                           'New FileAge: %s',
                           [DateTimeToStr(FileDateToDateTime(FileAge(OpenDialog1.FileName))),
                            DateTimeToStr(D)]));
    end;
Attachment
None
Comments

Peter Wokke at 12/22/2013 5:04:37 PM -
This difference is seen in

Delphi2010,  Delphi XE and Delphi XE4

and maybe in all other versions between.

Tomohiro Takahashi at 12/22/2013 5:09:00 PM -
What versions of Delphi should we use to reproduce your issue?

> There is one second difference in the deprecated version and the new one.
and, could you tell us more detail about the issue?

Server Response from: ETNACODE01