aVadim483 / fast-excel-laravel

Lightweight and very fast XLSX Excel Spreadsheet Export/Import for Laravel
MIT License
16 stars 5 forks source link

How to convert XLSX date column to Y-m-d H:i:s #1

Closed ipds3215 closed 1 year ago

ipds3215 commented 1 year ago

excel date value: 45133.401623495 i try to set $row['arrival']->setDateFormat('Y-m-d H:i:s') but got error Call to a member function setDateFormat() on float and if set to $row['arrival']->date('Y-m-d H:i:s',$row['arrival']), it get wrong date i try to set colFormats to '@datetime' but not works

ipds3215 commented 1 year ago

nevermind, i manage to solve the problem.

  1. set colFormat each column accordingly
  2. the when i save the data to Table, i set format like php object each column accordingly, for example for datetime i set $row['arrival']->date('Y-m-d H:i:s',$row['arrival'])

that its solve the problem. thx for this library