PHPExcel How to set a date in cell

后端 未结 2 1084
攒了一身酷
攒了一身酷 2021-01-20 03:28

I need to put a date in a cell, when I take a look to its format it looks like *14/03/01.

The value I put is a simple string and for that reason when I get the calcu

2条回答
  •  旧时难觅i
    2021-01-20 03:40

    $duree = '08:00:00';
    PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );
    $sheet->setCellValueByColumnAndRow($row, $num, $duree);
    $sheet->getStyleByColumnAndRow($row, $num)
          ->getNumberFormat()
          ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3);
    

    And in my cell i can see 08:00

提交回复
热议问题