Why current UTC time on my local server and UTC time on my hosting server are different?

人盡茶涼 提交于 2019-12-25 07:06:39

问题


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 

回答1:


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.

Check this out: http://www.cyberciti.biz/faq/howto-install-ntp-to-synchronize-server-clock/



来源:https://stackoverflow.com/questions/25803590/why-current-utc-time-on-my-local-server-and-utc-time-on-my-hosting-server-are-di

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!