【问题标题】:Kohana date warning messageKohana 日期警告消息
【发布时间】:2012-05-07 14:40:32
【问题描述】:

我的网站管理面板通过 Kohana 编码。当点击 Corporate->Add New 时,出现问题:

An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator.

panel/application/controllers/admin/corporate/news.php [82]:

date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Helsinki' for 'EEST/3.0/DST' instead

和堆栈跟踪:

panel/application/controllers/admin/corporate/news.php [82]:

date( Y-m-d, 1336401401 )

News_Controller->add(  )

82.行:

$dbForm->date->value = date('Y-m-d',time());

什么问题?谢谢。

【问题讨论】:

    标签: php database kohana


    【解决方案1】:

    在您的 bootstrap.php 中,您是否注释掉了您设置的默认时区行(3.2.0 默认安装中的第 25 行):

    date_default_timezone_set('America/Chicago');
    

    这就是它所抱怨的。

    【讨论】:

    • 但是我使用的是 Kohana 2 版本并且在 bootstrap.php 中没有找到日期函数
    • 添加它。这是一个 PHP 函数,可能会解决您的问题。
    猜你喜欢
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多