值是几天过去了自1900年以来,您可以使用内置的功能PhpSpreadsheet将其转换为Unix时间戳量:
$value = $worksheet->getCell('A1')->getValue();
$date = PhpOfficePhpSpreadsheetSharedDate::excelToTimestamp($value);
或一个PHP DateTime
对象:
$value = $worksheet->getCell('A1')->getValue();
$date = PhpOfficePhpSpreadsheetSharedDate::excelToDateTimeObject($value);