ggreen86 / XLSX-Workbook-Class

VFP Class to Create an XLSX Workbook without Excel Automation or Installed
45 stars 16 forks source link

Timezone not taken into account when writing document properties #111

Closed Starfiresg1 closed 6 months ago

Starfiresg1 commented 6 months ago

Hi,

during creation of the document properties (core.xml) the created and modified times are stored using the local time and appendig "Z" which meens it will be interpreted into an UTC-value. This leeds to an offset betwenn the actual creation time and the time noted in the document properties. It would be good to either convert the local time to UTC before writing the file or replacing "Z" with the correct timezone offset.

Example: 2024-02-12T08:38:37+03:00 instead of 2024-02-12T08:38:37Z first value will be displayed as 2024-02-12 08:38:37 in the properties - second instead as 2024-02-12 05:38:37 (assuming a timezone offset of +3 hours to UTC).

As an example the offset can be determined using GetTimeZoneInformation-API both for normal time and DST if apliccable to the time zone.

ggreen86 commented 6 months ago

Thank you for your identifying this and providing a solution. I have incorporated your suggestion into the class in Release 41. This will be added to this site this week.