我在Infinityfree平台中托管了我的PHP网站,但是时区有一些错误
我想从数据库中获取时间,并想向用户显示它,但是我看到插入的时区是绝对错误的,我知道该服务器中的时区不是“ Asia/kolkata”,但我可以更改它通过函数date_default_timezone_set()
在PHP中可用,如果不是,则该怎么办?
I want to fetch the time from the database and want to show it to the user, but I saw the timezone inserted there, is absolutely wrong, I understood that the timezone is not 'Asia/Kolkata' in that server, but can I change it by function date_default_timezone_set()
available in PHP, if not then how can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从PHP程序连接到数据库后,
显然将SQL语句放在您自己的时区。服务器时区通常设置为UTC,但可以设置为所有者的本地时间。如果您没有设置自己的时区,则您将获得服务器的时区。
Right after you connect from your php program to the database, give the SQL statement
Put in your own time zone, obviously. Server time zones are usually set to UTC, but may be set to the local time of their owners. If you don't set your own time zone, you'll get the server's time zone, whatever it happens to be.