SpartnerNL / Laravel-Excel

🚀 Supercharged Excel exports and imports in Laravel
https://laravel-excel.com
MIT License
12.28k stars 1.92k forks source link

Why my date column always return int value?. How can I get the origin value? because its int value is wrong #4048

Closed vinaynarendrapeeta closed 9 months ago

vinaynarendrapeeta commented 10 months ago

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

What version of Laravel Excel are you using?

3.1

What version of Laravel are you using?

9

What version of PHP are you using?

8.2

Describe your issue

I am using Laravel 9 and Laravel-excel is 3.1. In the excel sheet, in one field only i need to take all datatype values. and also how to check whether it is date or integer value getting from excel sheet

How can the issue be reproduced?

I am using Laravel 9 and Laravel-excel is 3.1. In the excel sheet, in one field only i need to take all datatype values. and also how to check whether it is date or integer value getting from excel sheet

What should be the expected behaviour?

I am using Laravel 9 and Laravel-excel is 3.1. In the excel sheet, in one field only i need to take all datatype values. and also how to check whether it is date or integer value getting from excel sheet

ittranvantruong commented 10 months ago

I'm also getting the same error. Column in file excel with format date when import it value int

ittranvantruong commented 10 months ago

I have found the cause. when i import value column get in with format cells category general or text.

image image
Arsham-rmz commented 9 months ago

Any idea ?!

patrickbrouwers commented 9 months ago

You have to convert the int value (which is an Excel timestamp) to a datetime. See https://docs.laravel-excel.com/3.1/exports/column-formatting.html#dates