首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用excel导入ms excel

使用excel导入ms excel
EN

Stack Overflow用户
提问于 2018-08-30 05:48:18
回答 1查看 41关注 0票数 0

当使用ms excel文件导入excel时,无法工作,请获取此错误

代码语言:javascript
复制
Array ( [0] => 42000 [1] => 1065 [2] => Query was empty ) 
Warning: A non-numeric value encountered in C:\xampp\htdocs\Classes\PHPExcel\Shared\Date.php on line 135

Warning: A non-numeric value encountered in C:\xampp\htdocs\Classes\PHPExcel\Shared\Date.php on line 136

Warning: A non-numeric value encountered in C:\xampp\htdocs\Classes\PHPExcel\Shared\Date.php on line 137

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\Classes\PHPExcel\CachedObjectStorage\CacheBase.php on line 196

date.php

代码语言:javascript
复制
 if ($dateValue >= 1) {
            $utcDays = $dateValue - $myexcelBaseDate;
            $returnValue = round($utcDays * 86400);
            if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) {
                $returnValue = (integer) $returnValue;
            }
        } else {
            $hours = round($dateValue * 24);
            $mins = round($dateValue * 1440) - round($hours * 60);
            $secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60);
            $returnValue = (integer) gmmktime($hours, $mins, $secs);
        }

但它正在为libre office.Any的帮助工作,将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-30 06:14:22

我认为您可以直接转换为int $dateValue = (int)$dateValue;

我把其他线下面的是135,136,137

代码语言:javascript
复制
if ($dateValue >= 1) {
    $utcDays = $dateValue - $myexcelBaseDate;
    $returnValue = round($utcDays * 86400);
    if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) {
        $returnValue = (integer) $returnValue;
    }
} else if ($dateValue < 0){
    $dateValue = (int)$dateValue;
    $hours = round($dateValue * 24);
    $mins = round($dateValue * 1440) - round($hours * 60);
    $secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60);
    $returnValue = (integer) gmmktime($hours, $mins, $secs);
}

另外,有时你必须增加执行时间,你可以这样做:

代码语言:javascript
复制
set_time_limit(60); // 60 seconds.
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52089957

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档