douzhaochan6468 2013-07-22 09:42
浏览 85

使用mysql和php夏令时

Quick question:

I have an issue with daylight savings time affecting the output of data on my website.

Everything is showing as being a hour ahead (we are currently in the middle of BST).

How do I make my database recognise when it's DST and output accordingly?

Programming language is PHP Database is MySQL The data in question is formatted as a DATETIME

And my code is:

<?php
echo date('D, jS F @ g:ia', strtotime($event_date));
?>
  • 写回答

2条回答 默认 最新

  • douxie1957 2013-07-22 10:16
    关注

    use date_default_timezone_set('UTC'); (you might want to take a look at the php manual)

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器