Skip to content

Date::excelToDateTimeObject fatal errorstale #4696

@LRemy-Gac

Description

@LRemy-Gac

Hello,

I'm in the same case as presented in this issue, which have been closed, without a possible fix.
I understand that a potential fix would add some complexity into the code, but by raising an exception that would prevent some fatal errors.

In my case I'm extracting data from xls/xlsx files from which I don't have any control on the data.

Some cells are marked as "Datetime" (\PhpOffice\PhpSpreadsheet\Shared\Date::isDateTime($cell) => return true) but when I use "excelToDateTimeObject" on the cell value after that control it trigger a fatal error because it return a boolean instead of a Datetime object.

it's a marginal case but it is here.

Any fix possible ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions