php 读取Excel内容时 对时间的值进行格式化处理

值是几天过去了自1900年以来,您可以使用内置的功能PhpSpreadsheet将其转换为Unix时间戳量:

$value = $worksheet->getCell('A1')->getValue(); 
$date = PhpOfficePhpSpreadsheetSharedDate::excelToTimestamp($value); 

或一个PHP DateTime对象:

$value = $worksheet->getCell('A1')->getValue(); 
$date = PhpOfficePhpSpreadsheetSharedDate::excelToDateTimeObject($value); 
原文地址:https://www.cnblogs.com/gaogaoxingxing/p/13424933.html