PHP and System Time not Sync to Timezone

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
piktoy
Posts: 24
Joined: Fri Jul 06, 2012 10:13 am

PHP and System Time not Sync to Timezone

Post by piktoy »

Hi,

Can advise how to sync the php time and system time to current timezone set, the time is delay of almost 12hrs, please help.
follow the xi_changing_time documentation but still not sync.

Date/Time

PHP Timezone: Asia/Singapore
PHP Time: Sun, 28 Jul 2013 22:08:51 +0800
System Time: Sun, 28 Jul 2013 22:08:51 +0800
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: PHP and System Time not Sync to Timezone

Post by abrist »

Is the current timezone is correct?
Are you running ntp?
Have you restarted the httpd server?

Code: Select all

service httpd restart
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: PHP and System Time not Sync to Timezone

Post by lmiltchev »

This is strange - they seem to be synced. Did you try restarting the server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
piktoy
Posts: 24
Joined: Fri Jul 06, 2012 10:13 am

Re: PHP and System Time not Sync to Timezone

Post by piktoy »

timezone is correct but the system php/server time is not sync to timezone. Singapore is +0800 GMT

restarted server and httpd same thing.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PHP and System Time not Sync to Timezone

Post by scottwilkerson »

I am confused, why do you think they aren't synced? These look like a match to me...
piktoy wrote:PHP Time: Sun, 28 Jul 2013 22:08:51 +0800
System Time: Sun, 28 Jul 2013 22:08:51 +0800
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
piktoy
Posts: 24
Joined: Fri Jul 06, 2012 10:13 am

Re: PHP and System Time not Sync to Timezone

Post by piktoy »

scottwilkerson wrote:I am confused, why do you think they aren't synced? These look like a match to me...
piktoy wrote:PHP Time: Sun, 28 Jul 2013 22:08:51 +0800
System Time: Sun, 28 Jul 2013 22:08:51 +0800

oh meaning the timezone singapore current time is not sync to what sytem profile shows

the current time in singapore now is July31 - Wed - 10am, but the server time is late
----------
PHP Timezone: Asia/Singapore
PHP Time: Tue, 30 Jul 2013 21:54:00 +0800
System Time: Tue, 30 Jul 2013 21:54:00 +0800
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PHP and System Time not Sync to Timezone

Post by scottwilkerson »

Oh.....

run

Code: Select all

yum install ntp -y
then

Code: Select all

ntpdate pool.ntp.org
ntpdate pool.ntp.org
service ntpd start
date
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked