Page 1 of 1
PHP and system time are different
Posted: Mon Apr 15, 2013 12:11 pm
by benningtonr
I have tried setting the local time as described in a few topic here, but it still says UTC, no NewYork time
[root@nagios ~]# date
Mon Apr 15 17:08:22 UTC 2013
[root@nagios ~]#
PHP time and time zone are correct, just system time is wrong.
Thanks for any available advice
Oh I tried:
[root@nagios ~]# mv /etc/localtime /etc/localtime.bak
mv: overwrite `/etc/localtime.bak'?
[root@nagios ~]# ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
ln: creating symbolic link `/etc/localtime': File exists
I rebooted and still UTC
Re: PHP and system time are different
Posted: Mon Apr 15, 2013 12:53 pm
by sreinhardt
Are you able to use ntp on your network? If so
this article would be very helpful. Otherwise, let's check where /etc/localtime is pointed presently.
ll /etc/localtime
Another link that might be of interest
http://www.linuxsa.org.au/tips/time.html
Re: PHP and system time are different
Posted: Wed May 22, 2013 10:11 am
by benningtonr
I have NTP setup, and the time is still wrong.
[root@nagios mail]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.98.10 .STEP. 1 u 44 64 7 0.384 9.370 6.278
bindcat.fhsu.ed .STEP. 16 u - 64 0 0.000 0.000 0.000
kapu.skafari.co .STEP. 16 u - 64 0 0.000 0.000 0.000
services.quadra 216.218.192.202 2 u 54 64 3 77.256 -19.120 4.478
Re: PHP and system time are different
Posted: Wed May 22, 2013 10:23 am
by abrist
I just updated the time/zoneinfo document a few days ago. This should cover configuring the system zone and time, as well as ntp:
http://assets.nagios.com/downloads/nagi ... m_Time.pdf
Re: PHP and system time are different
Posted: Wed May 22, 2013 10:45 am
by benningtonr
Times are all set.
One question though, if from the CLI i type date, i get the correct time, but if I type clock, i get utc still.
My graphs are correct so it is not a problem, but I am curious.
Re: PHP and system time are different
Posted: Wed May 22, 2013 10:49 am
by slansing
I believe clock uses your hardware clock's time, that would be the only difference I can think of.
Re: PHP and system time are different
Posted: Wed May 22, 2013 10:50 am
by benningtonr
ok sounds reasonable
Thanks
Re: PHP and system time are different
Posted: Wed May 22, 2013 10:55 am
by slansing
Closing as resolved.