【发布时间】:2018-10-26 06:14:46
【问题描述】:
美好的一天。我使用 PhpSpreadsheet 的库来导入 xlsx。
在 xlsx 的 I 列中,我有这个值 20/10/1970 00:00:00 显示为 1970-10-20 00:00:00 但是当我导入它时:
$dataArray = $spreadsheet->getActiveSheet()
->rangeToArray(
'A2:AO3', // The worksheet range that we want to retrieve
NULL, // Value that should be returned for empty cells
NULL, // Should formulas be calculated (the equivalent of getCalculatedValue() for each cell)
TRUE, // Should values be formatted (the equivalent of getFormattedValue() for each cell)
TRUE // Should the array be indexed by cell row and cell column
);
我收到奇怪的["I"] => float(25861) 请帮我获取该字段中的 Carbon 数据。
如果我尝试将此浮点数转换为时间戳,我会收到 01/01/1970 而不是 10/20/1970
我收到的其他日期,例如["J"] => float(43195.4092014)
【问题讨论】:
标签: php phpspreadsheet