我正在使用日期和时间单元格值,当日期值正常工作时,时间证明有点痛苦。
$value = $worksheet->getCell($cellPosition)->getValue();
$date = new \DateTime();
$date->setTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($value));
echo '<td>' . $date->format('i:s') . '</td>' . PHP_EOL;
但是,在此示例中:$value
是:0.375 而不是:09:00,因此格式化失败。
如何禁用此默认值格式?