Page 1 of 1
PHP and System Time not Sync to Timezone
Posted: Sun Jul 28, 2013 9:11 pm
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
Re: PHP and System Time not Sync to Timezone
Posted: Mon Jul 29, 2013 9:45 am
by abrist
Is the current timezone is correct?
Are you running ntp?
Have you restarted the httpd server?
Re: PHP and System Time not Sync to Timezone
Posted: Mon Jul 29, 2013 9:46 am
by lmiltchev
This is strange - they seem to be synced. Did you try restarting the server?
Re: PHP and System Time not Sync to Timezone
Posted: Mon Jul 29, 2013 9:52 pm
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.
Re: PHP and System Time not Sync to Timezone
Posted: Tue Jul 30, 2013 7:53 am
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
Re: PHP and System Time not Sync to Timezone
Posted: Tue Jul 30, 2013 8:55 pm
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
Re: PHP and System Time not Sync to Timezone
Posted: Tue Jul 30, 2013 8:58 pm
by scottwilkerson
Oh.....
run
then
Code: Select all
ntpdate pool.ntp.org
ntpdate pool.ntp.org
service ntpd start
date