This repository was archived by the owner on Jan 2, 2019. It is now read-only.
This repository was archived by the owner on Jan 2, 2019. It is now read-only.
PHPExcel_Shared_Date::PHPToExcel does not work with objects implementing DateTimeInterface #907
Closed
Description
When attempting to use PHPExcel_Shared_Date::PHPToExcel
with a DateTimeImmutable
false is being returned rather than the converted value.
<?php
$date = new DateTime();
$excel_date = PHPExcel_Shared_Date::PHPToExcel($date);
var_dump($excel_date);
$date = new DateTimeImmutable();
$excel_date = PHPExcel_Shared_Date::PHPToExcel($date);
var_dump($excel_date);
?>
The above code will output:
double(42517.61150463)
bool(false)
It appears that the method uses instanceof DateTime
rather than instanceof DateTimeInterface
.
Metadata
Metadata
Assignees
Labels
No labels