为什么我本地服务器上的当前 UTC 时间和我的托管服务器上的 UTC 时间不同? [英] Why current UTC time on my local server and UTC time on my hosting server are different?

查看:28
本文介绍了为什么我本地服务器上的当前 UTC 时间和我的托管服务器上的 UTC 时间不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地服务器和托管服务器上打印了以下代码,但似乎都显示了差异.UTC 时区的时间.请解释一下.

I printed below code on my local server and on my hosting server but seems both displaying diff. time for UTC timezone. Please explain me.

echo print gmdate("Y-m-d\TH:i:s\Z"); 

//Output on LOCAL SERVER: 2014-09-12T08:02:49Z1UTC //It is the correct one 

//Output on HOSTING SERVER: 2014-09-12T06:51:39Z1 

推荐答案

最后,我得到了解决方案.实际上我的服务器时间与世界时钟不同步.我需要在我的服务器上安装 NTP(网络时间协议)服务.我已使用以下链接安装在 CentOs 上.

Finally, I got the solution. Actually my server time is not sync with world clock. I needed to install NTP (Network Time Protocol) service on my server. I have installed on CentOs using below link.

看看这个:http://www.cyberciti.biz/faq/howto-install-ntp-to-synchronize-server-clock/

这篇关于为什么我本地服务器上的当前 UTC 时间和我的托管服务器上的 UTC 时间不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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