插入日期

优质
小牛编辑
118浏览
2023-12-01
insertDate(int $row, int $column, int $timestamp[, string $dateFormat = 'yyyy-mm-dd hh:mm:ss', resource $formatHandler])

int $row
$excel = new \Vtiful\Kernel\Excel($config);
​
$dateFile = $excel->fileName("free.xlsx")
    ->header(['date']);
​
$dateFile->insertDate(1, 0, time(), 'mmm d yyyy hh:mm AM/PM');
​
$textFile->output();

时间格式化字符示例

更多样式请参考 Excel 微软文档

"mm/dd/yy"
"mmm d yyyy"
"d mmmm yyyy"
"dd/mm/yyyy hh:mm AM/PM"