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.

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

报告相同问题?

悬赏问题

  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM