go 後臺報存的格式
if (($k == $_content['property_id']) && ($attrTpye == 'date')) {
$date = date_create($_val);
$_val = date_format($date, 'Y-m-d');
break;
}
if (($k == $_content['property_id']) && ($attrTpye == 'time')) {
$date = date_create($_val);
$_val = date_format($date, 'Y-m-d H:i:s');
break;
}
PhpSpreadsheet execl 上的格式化 儲存go 後臺
if (isset($format) && 'm/d/yyyy' == $format) {
$cell->getStyle()->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2);
}
if (isset($format) && 'm/d/yyyy h:mm' == $format) {
$cell->getStyle()->getNumberFormat()->setFormatCode('yyyy-mm-dd H:i:s');
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結