Wrong timestaps in XLSX files.

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
d3nton
Posts: 137
Joined: Thu Oct 25, 2012 9:48 am

Wrong timestaps in XLSX files.

Post by d3nton »

Hello.
The 'Date' and the 'Date last saved' timestamps are always set to 1/1/2000 instead of the correct value.
Please take a look at this picture:
http://www.file-upload.net/download-823 ... t.png.html.
Could you please fix this.
Thank you.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Wrong timestaps in XLSX files.

Post by larsa »

Hello

Will be fixed in update 5.20.07, ready by the beginning of next week. See release notes for details.
Lars Arvidsson, Axolot Data
d3nton
Posts: 137
Joined: Thu Oct 25, 2012 9:48 am

Re: Wrong timestaps in XLSX files.

Post by d3nton »

Thank you very much for your good support and the quick fix!
d3nton
Posts: 137
Joined: Thu Oct 25, 2012 9:48 am

Re: Wrong timestaps in XLSX files.

Post by d3nton »

Hello.

I seems that there is still a small bug in V5.20.18
In my timezone (UTC +1:00) the 'Date last saved' is currently 1 hour ahead.
E.g. instead of 9:00 (the current time) it is 10:00. Other Dates like creation date or modified date are correct.
d3nton
Posts: 137
Joined: Thu Oct 25, 2012 9:48 am

Re: Wrong timestaps in XLSX files.

Post by d3nton »

Microsoft is really inconsistent in saving date values in the docprops such as 'created' and 'modified' dates.
I found out that the 'modified' date is saved in UTC whereas other time values like 'created' are saved as local time.
A fix can be implemented in XC12Manager5.pas. You can use the SystemTime for the DateModified docprop:

Code: Select all

procedure TXc12Manager.BeforeWrite;
var
  YY,MM,DD: word;
  UTC: SystemTime;
begin
  FStyleSheet.BeforeWrite;
  FGrManager.BeforeWrite;
  if FDocProps.AutoUpdate then begin
    DecodeDate(FDocProps.DateCreated,YY,MM,DD);
    if (FDocProps.DateCreated = 0) or (YY <= 2000) then
      FDocProps.DateCreated := Now;
    GetSystemTime(UTC);
    FDocProps.DateModified := SystemTimeToDateTime(UTC);
  end;
end;
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Wrong timestaps in XLSX files.

Post by larsa »

Hello

Fixed in update 5.20.19
Lars Arvidsson, Axolot Data
Post Reply