1

I am using PHPExcel to read date cells in excel file that have values like 'Mar-13' but it is returning integer values like '41791'. Please, what do I need to do make sure that the date reads in correctly?

1 Answer 1

6

Excel stores dates as serialized timestamps (number of days since 1/1/1900), which you can convert to Unix timestamp and format it with standard php date functions

$unix_timestamp = ($cell_value - 25569) * 86400;
$phpdate = date("m-d-Y", $unix_timestamp);
Sign up to request clarification or add additional context in comments.

1 Comment

How can I check the value is having date or not using PHP spreadsheet ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.