Date-Time for a timezone

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Date-Time for a timezone

Post by Sbergonzi »

I updated the php.ini to be East Coast time in support of the "Last Updated" note under each dashlet. What I'm now curious about is the actual data. Would the x-axis also be in EST?
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Date-Time for a timezone

Post by tmcdonald »

It should be EST as well. The right-most side of the graph is the current time, and the x-axis labels are very 6 hours, so you can eyeball it and see if the current time is an appropriate distance from the last label.
Former Nagios employee
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Date-Time for a timezone

Post by Sbergonzi »

I took this pic at 15:00 EST and it shows 21:00 at the right most point. That confused me.
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Date-Time for a timezone

Post by tmcdonald »

Is your system time synced up with your PHP time?

Please run the following:

Code: Select all

grep "date.timezone" /etc/php.ini
php -r 'echo date("D M j G:i:s T Y")."\n";'
date
Former Nagios employee
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Date-Time for a timezone

Post by Sbergonzi »

My 12-hour math was wrong earlier, it was 2 p.m. PST which is 5 p.m. EST/17:00 EST.

It looks like it's not. Should i fix the system time and that will fix the graph times?

[root@Nagios1 ~]# grep "date.timezone" /etc/php.ini
; http://www.php.net/manual/en/datetime.c ... e.timezone
date.timezone = America/New_York
[root@Nagios1 ~]# php -r 'echo date("D M j G:i:s T Y")."\n";'
Wed Apr 16 17:16:29 EDT 2014
[root@Nagios1 ~]# date
Wed Apr 16 21:16:33 UTC 2014
[root@Nagios1 ~]#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Date-Time for a timezone

Post by tmcdonald »

The following should fix you up:

Code: Select all

rm /etc/localtime
cp /usr/share/zoneinfo/America/New_York /etc/localtime
assuming that New York is the proper system time you would want. As long as PHP matches the system you are fine.
Former Nagios employee
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Date-Time for a timezone

Post by Sbergonzi »

good to go! thank you!

yes, our data center is on the east coast so all times EST.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Date-Time for a timezone

Post by tmcdonald »

Sbergonzi wrote:good to go! thank you!

yes, our data center is on the east coast so all times EST.
Great. It will take a bit for everything to sync up and you may see some issues until then.

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked