PHP不同时区 [英] Php different timezones

查看:66
本文介绍了PHP不同时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 php mysql 中开发一个网络应用程序,它应该可以在全世界使用.在这个应用程序中有大量的时间,所以我想知道是否有是否需要对时区差异进行处理,或者 php 是否在保存到数据库之前自动识别不同的时区?

I'm developing a web app in php mysql which should be usable in the whole world. In this app there is a big usage of time so I'm wondering if there is any work to do on the timezones differences or if php is automatically recognizing the different timezones before saving in the db ?

感谢您的帮助

推荐答案

MySQL 服务器时区支持

并确保您将所有日期和时间以 UTC 格式存储在数据库中.这是保持理智的唯一方法.

And ensure that you store all dates and times in the database in UTC. It's the only way to remain sane.

这篇关于PHP不同时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆