[英]How can I do so that multiple users can access their current timezone instead of the one provided by my server using PHP
When I echo当我回响
date_default_timezone_get()
It echo's the server datetime instead of my current timezone.它回显的是服务器日期时间,而不是我当前的时区。 I wanted to have my real timezone.
我想拥有我的真实时区。 How can I proceed with this.
我该怎么做。
You can set your default zone with:您可以使用以下方式设置默认区域:
date_default_timezone_set('America/Los_Angeles');
and get it:并得到它:
$your_timezone = date_default_timezone_get();
Here you can check supported timezones.在这里您可以查看支持的时区。
PS: When you know how to set timezone, you can get users browser timezone, tutorial but you should use JS:) PS:当你知道如何设置时区时,你可以获取用户浏览器时区,教程但你应该使用 JS :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.