duai8153 2012-10-30 14:01
浏览 73
已采纳

cakePHP时区和时差

In my CakePHP 2 application I have time errors.
date_default_timezone_set value inside my Config/core.php is Europe/Athens. I used it successfully for months. But my codes gives wrong time values after the Daylight saving time passed in 28 october 2012.

When I put this inside my controller I get right time and date.

public function dateTimeShow(){
    echo "date:".date('Y-m-d')."<br>";
    echo "time:".date('H:i:s')."<br>";
}

But the date('H:i:s') value gives normal time-2:00 values. How can I debug or solve this?
Thank you

Edit: When I print out date_default_timezone_get() I get result: UTC
When I print out ini_get('date.timezone') I get results: Europe/Athens (which is right)

  • 写回答

2条回答 默认 最新

  • dongrendang6566 2012-12-19 07:44
    关注

    I found my error after some weeks. I was importing a vendor's files. And it was corrupting my timezone value. I fixed this after chaning the vendor setting file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题