How to retrieve date from table cell using PhpSpreadsheet?

后端 未结 4 563
庸人自扰
庸人自扰 2020-12-06 06:14

I have xlsx tables and I use PhpSpreadsheet to parse them. Some cells format is date. The problem is that PhpSpreadsheet returns the values from date-formatted

4条回答
  •  攒了一身酷
    2020-12-06 06:55

    When we are iterating with $row->getCellIterator() or we might have other kinds of value, it might be useful to use getFormattedValue instead

    while using getValue()

    • Full name: Jane Doe => "Jane Doe"
    • DOB: 11/18/2000 => 36848.0

    while using getFormattedValue()

    • Full name: Jane Doe => "Jane Doe"
    • DOB: 11/18/2000 => "11/18/2000"

提交回复
热议问题