close

[Solved] Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this? in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this Error Occurs?

Today I get the following error Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this? in php.

How To Solve Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this Error ?

  1. How To Solve Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this Error ?

    To Solve Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this Error I tried the above solution but always get stuck with non-numeric value error

  2. Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

    To Solve Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this Error I tried the above solution but always get stuck with non-numeric value error

Solution 1

I tried the above solution but always get stuck with non-numeric value error

I manage to solve this using


$date = intval($row['value']);

\PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($date)->format('d/m/Y')

Solution 2

Solved! This is the code I used to solve my problem:

Carbon\Carbon::instance(\PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($value));

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment