You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [ ] 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 DateTimes 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 to DateTime with Date::excelToDateTimeObject method. Resulted DateTime instance will be different from original file(4 years different to be more specific).
Which versions of PhpSpreadsheet and PHP are affected?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
This is:
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 thePhpOffice\PhpSpreadsheet\Shared\Date::$excelCalendar
value will beself::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?
A
file created on Windows system.B
file created on Mac system.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"
The text was updated successfully, but these errors were encountered: