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 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建