i want to convert this 5 digit number into date format from excell to database

Viewed 35

i will provide this specific code.

i first convert the excel file to array of object in php.

in the excell file i have 2022/08/08 format and when i insert it to database it gives me this value 44824

and i convert this 44824 using this code

gmdate("Y-m-d", ($arr['excelDatas'][0]['date_hired'] - 25569) * 86400)

just ignore the $arr['excelDatas'][0]['date_hired'] - this is just the value

this is the result 2022-09-20

as you can see the date in excell is different to the converted one 2022/08/08 != 2022-09-20

where did i fall short?

0 Answers
Related