【发布时间】:2019-06-09 10:00:12
【问题描述】:
在Codeigniter 上使用PHPExcel 设置我的日期格式时遇到问题
我已经有你可以访问的控制器、模型和视图
型号:http://sistempintar.com/file/LingkunganModel.txt
控制器:http://sistempintar.com/file/Lingkungan.txt
查看:http://sistempintar.com/file/form.txt
我在导入数据库之前进行了预览,但是出现了一个错误提示
"遇到 PHP 错误,严重性:警告
消息:date_create():依赖系统的不安全 时区设置。您需要使用 date.timezone 设置 或 date_default_timezone_set() 函数。如果您使用任何 这些方法,您仍然收到此警告,您很可能 时区标识符拼写错误。我们选择了时区“UTC” 现在,但请设置 date.timezone 以选择您的时区。
文件名:Shared/Date.php
行号:167
回溯:
文件: /home/u4502442/public_html/sistempintar/demo/proyek/application/third_party/PHPExcel/PHPExcel/Shared/Date.php 行:167 函数:date_create
文件: /home/u4502442/public_html/sistempintar/demo/proyek/application/third_party/PHPExcel/PHPExcel/Style/NumberFormat.php 行:454 函数:ExcelToPHPObject
文件: /home/u4502442/public_html/sistempintar/demo/proyek/application/third_party/PHPExcel/PHPExcel/Style/NumberFormat.php 行:607 函数:_formatAsDate
文件: /home/u4502442/public_html/sistempintar/demo/proyek/application/third_party/PHPExcel/PHPExcel/Worksheet.php 行:2493 函数:toFormattedString
文件: /home/u4502442/public_html/sistempintar/demo/proyek/application/third_party/PHPExcel/PHPExcel/Worksheet.php 行:2556 函数:rangeToArray
文件: /home/u4502442/public_html/sistempintar/demo/proyek/application/controllers/Lingkungan.php 行:51 函数:toArray
文件:/home/u4502442/public_html/sistempintar/demo/proyek/index.php 行:315 功能:require_once"
这是我的 date.php:http://sistempintar.com/file/date.txt
这是显示错误的图片:
http://sistempintar.com/file/format_database.png
我不知道怎么回事,请帮忙
【问题讨论】:
-
In your php.ini config 或 before you start calling 您的日期函数
set date.timezone to select your timezone根据错误消息。 -
你的意思是在我的 date.php 上?
-
即使我将 date.timezone 设置为我的时区,错误仍然相同
-
好的,您要修复什么错误?日期错误还是函数错误?
-
当处理从excel(预览后)输入到数据库时,数据库上的日期将为0000-00-00的错误,但是当我尝试121212时,数据库上的日期将是2012/ 12/12
标签: php codeigniter phpexcel