About PHP Reading Excel issues
When you read an Excel file in a PHP Excel class, the value of the date cannot be displayed correctly if you encounter an Excel file with a column that is of the date type. How do I get PHP to automatically determine if the column being read is a date type, and if the date type is converted to a value that can be displayed correctly by the conversion function.
------Solution--------------------
I've done this, give you a function, try it, I found it on the internet before.
PHP Code
Excel date Conversion functions function Exceltime ($days, $time =false) { if (is_numeric ($days)) { //based on 1900-1-1 $JD = GREGORIANTOJD (1, 1, 1970); $gregorian = Jdtogregorian ($jd +intval ($days) -25569); $myDate = explode ('/', $gregorian); $MYDATESTR = Str_pad ($myDate [2],4, ' 0 ', str_pad_left) . " -". Str_pad ($myDate [0],2, ' 0 ', str_pad_left) ." -". Str_pad ($myDate [1],2, ' 0 ', Str_pad_left) . ( $time? " 00:00:00 ":"); return $myDateStr; } ElseIf (Strpos ($days, '. ')! ==0) { return Str_replace ('. ', '-', $days); } return $days;}