使用phpspreadsheet导入的时候读取的实际是这个单元格的常规格式,这个43320的意思就是1900-01-01到现在过去了多少天
但是PHP是计算从1970-01-01开始的,所以需要减去这中间70年的天数
即: 365*70 + 18(中间的润年天数) + 1 = 25569
那么用43320 - 25569 = 17751天
17751 * 24 * 3600 = 1533686400
$date = $spreadsheet->getActiveSheet()->getCellByColumnAndRow(1, $row)->getValue();
$date = date('Y-m-d', ($date - 25569) * 24 * 3600);


发表评论 取消回复