Bug 143716 - FILEOPEN DBF timestamp fields (type '@') trigger corruption error
Summary: FILEOPEN DBF timestamp fields (type '@') trigger corruption error
Status: RESOLVED DUPLICATE of bug 143715
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-04 05:10 UTC by SheetJS
Modified: 2021-08-04 08:25 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SheetJS 2021-08-04 05:10:36 UTC
Description:
dBASE Level 7 DBF supports the timestamp field (type '@').  Valid DBF files generated from dBASE are flagged as corrupt and LibreOffice fails to repair them

Steps to Reproduce:
1. Download sample file https://github.com/SheetJS/test_files/raw/master/dbf/d11.dbf
2. open in LibreOffice


Actual Results:
Error message "The file 'd11.dbf' is corrupt and therefore cannot be opened. LibreOffice can try to repair the file."

Attempting to repair the file yields a new error message "The file 'd11.dbf' could not be repaired and therefore cannot be opened."

Expected Results:
The file opens properly and the field is interpreted as Date


Reproducible: Always


User Profile Reset: Yes



Additional Info:
SheetJS currently uses the following algorithm to extract values.  The algorithm agrees with dBASE 2019 on the values in the test file:

- Parse the 8 bytes of the field as an IEEE754 double in big-endian order
- Subtract 0x388317533400 (62135683200000, a number that can be exactly represented in a IEEE754 double)
- Interpret the code as milliseconds since January 1 1970 (which is what JS uses as the 0 value for the native Date object)
Comment 1 Julien Nabet 2021-08-04 08:25:01 UTC

*** This bug has been marked as a duplicate of bug 143715 ***