Time zone issue

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
JorisFRST
Cacti User
Posts: 220
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Time zone issue

#1 Post by JorisFRST » Thu Oct 10, 2019 7:11 am

Test server, so no big issue, my graphs are running 2 hours behind.

Server is in UTC, I am CET, so graph is showing time correctly, 12:00 instead of 14:00
Issue is the data in the graph is now only at 10:00
ping.png
ping.png (37.17 KiB) Viewed 654 times
I have set the server timezone : UTC

/etc/php/7.3/apache2/php.ini : UTC
/etc/php/7.3/cli/php.ini : UTC

and cactiuser can access time_zone_name on sql.

I have written a small php file to check my settings :

<?php
echo "php date : ";
echo date(DATE_RFC2822);
echo "\nphp timezone: " . ini_get('date.timezone') . PHP_EOL;
echo "\nmysql access time_zone_name : ";
$db = new PDO('mysql:host=192.168.1.3:3307;dbname=mysql', 'cactiuser', 'password');
$stmt = $db->query('select * from time_zone_name WHERE name=\'UTC\' ');
$id = $stmt->fetchColumn(0);
if ($id !== false) {
echo $id;
}
echo "\n";
?>

Output CLI :
php date : Thu, 10 Oct 2019 12:05:55 +0000
php timezone: UTC
mysql access time_zone_name : UTC

Output Web :
php date : Thu, 10 Oct 2019 12:06:47 +0000 php timezone: UTC mysql access time_zone_name : UTC


So now I'm stuck, I wouldn't know where to look next.
Joris.
http://www.routerjanitor.com

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Time zone issue

#2 Post by netniV » Thu Oct 10, 2019 10:52 am

What is your timezone setting against your profile/system in cacti?

User avatar
JorisFRST
Cacti User
Posts: 220
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: Time zone issue

#3 Post by JorisFRST » Thu Oct 10, 2019 2:03 pm

I'm sorry, I'm afraid I don't understand your question ?

My PC / brower is CET (UCT + 2)
Joris.
http://www.routerjanitor.com

User avatar
JorisFRST
Cacti User
Posts: 220
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: Time zone issue

#4 Post by JorisFRST » Tue Oct 22, 2019 9:21 am

Deleted all rrd's, still same issue.

Only when doing realtime it is showing the correct time.
Joris.
http://www.routerjanitor.com

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Time zone issue

#5 Post by netniV » Tue Oct 22, 2019 9:34 am

Realtime is using your browser time. Are your servers also set to use CET?

User avatar
JorisFRST
Cacti User
Posts: 220
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: Time zone issue

#6 Post by JorisFRST » Tue Oct 22, 2019 10:30 am

Everything in this test setup is set UTC

Realtime shows correct UTC time.

Browser is on CET machine.
Joris.
http://www.routerjanitor.com

Post Reply