doujiu8918 2011-03-16 19:53
浏览 126
已采纳

如何在PHP中将夏令时设置为关闭

I've got this line of code which set daylight saving "On" what would be the proper way to set it to "off"

// is daylight saving On?
$rcmail_config['dst_active'] = (bool)date('I');
  • 写回答

1条回答 默认 最新

  • duandi8544 2011-03-16 19:55
    关注

    date('I') (that's a capital letter i) returns 1 when the current default time zone is in DST.

    If it's returning 1 instead of 0 and the timezone in question is not in DST, either the timezone you've picked is incorrect or the time zone data it uses is out of date.

    If you can, please try using a DateTime object with a DateTimeZone object that has been set to the proper time zone. A format('I') call on the resulting object should be correct. If it isn't, then your time zone data is out of date. This is sometimes done at the server level. Please ensure that the server's time zone database is up to date. PHP sometimes includes it's own time zone data file, so you may need to actually update PHP instead.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog