-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- [ ] a bug report
- [x] a feature request
- [x] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
I've spent almost 5 hours to investigate weird bug. I've made a small parser application and covered it with unit tests. I didn't understand why my assert of DateTime
s fails when I add new test to completely unrelated class. As it turned out PHPUnit runs all tests simultaneously, so if one test contains reading of file in .numbers
format and second test handles .xlsx
then the PhpOffice\PhpSpreadsheet\Shared\Date::$excelCalendar
value will be self::CALENDAR_WINDOWS_1900
for both tests which is wrong.
What is the expected behavior?
I don't know how to fix this issue with current class architecture, it's obviously you cannot switch from static method to internal one.
What is the current behavior?
When I load Mac file and then Win file I expect to calculate DateTime
from Mac file correctly.
What are the steps to reproduce?
- Load spreadsheet
A
file created on Windows system. - Load spreadsheet
B
file created on Mac system. - Get value from datetime cell of the file
A
and convert it toDateTime
withDate::excelToDateTimeObject
method. ResultedDateTime
instance will be different from original file(4 years different to be more specific).
Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.4.6 (cli) (built: May 28 2020 23:40:38) ( NTS )
"phpoffice/phpspreadsheet": "^1.14"
Metadata
Metadata
Assignees
Labels
No labels