Timezone weirdness

I’ve search quite a bit for this but cannot seem to find an answer so here we go:
I installed libreNMS to a system configured for timezone CST. Pretty sure all that worked fine at the time.

Recently switched to UTC everywhere. the php files were changed from CST to UTC, system time was changed to UTC, as well as the user(s) preferences in the GUI. What I cannot seem to get fixed is the graph windows, where you enter the time frame you want. It continues to show CST while the graph itself (axis) is UTC. I have even rebooted the entire host to try and make sure there was not some process still hanging around during my debugging that didn’t pull in the change…

You can see in this picture, the graph is in UTC while the “from / to” time is in CST. Frustrating.


root@NMS HOST:/etc/php/8.1# find . -type f | xargs grep -i timezon
./fpm/php.ini:; Defines the default timezone used by the date functions
./fpm/php.ini:; https://php.net/date.timezone = UTC
./fpm/php.ini:date.timezone = UTC
./fpm/php.ini.bak:; Defines the default timezone used by the date functions
./fpm/php.ini.bak:; https://php.net/date.timezone = America/Chicago
./fpm/php.ini.bak:;date.timezone =
./cli/php.ini:; Defines the default timezone used by the date functions
./cli/php.ini:; https://php.net/date.timezone = UTC
./cli/php.ini:date.timezone = UTC
./cli/php.ini.bak:; Defines the default timezone used by the date functions
./cli/php.ini.bak:; https://php.net/date.timezone = America/Chicago
./cli/php.ini.bak:;date.timezone =

root@NMS HOST:/etc/php/8.1# cat /etc/timezone 

librenms@NMS HOST:~$ ./daily.sh 
Updating to latest codebase                        OK
Updating Composer packages                         OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK
librenms@NMS HOST:~$ ./validate.php 
Component | Version
--------- | -------
LibreNMS  | 24.1.0-99-g851f68215 (2024-02-22T17:07:49+00:00)
DB Schema | 2024_02_07_151845_custom_map_additions (290)
PHP       | 8.1.2-1ubuntu2.14
Python    | 3.10.12
Database  | MariaDB 10.6.16-MariaDB-0ubuntu0.22.04.1
RRDTool   | 1.7.2
SNMP      | 5.9.1

[OK]    Composer Version: 2.7.1
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[OK]    Redis is unavailable
[OK]    rrd_dir is writable
[OK]    rrdtool version ok

While I’m at it: Is there a way to invert the Y axis to reverse the in/out graphing?

Hello. Welcome.

I suggest you check the variables indicated in the official installation documentation

Time Zone Coding Reference PHP: List of Supported Timezones - Manual


Maybe I’m just dense, but the PHP reference specifically says I should use UTC, not Etc/UTC. UTC is also listed as one of the variable options. As a test, however, I went ahead and updated everything to Etc/UTC and I still have the same issue.

The “to”/“from” field is still not in sync with the Graph axis and it is still off by -6hrs. I set all of these variables and rebooted the host.

Personally, I used the suggested configuration and it worked for me.

Maybe your issue comes from another side.

Well that was weird.
I set the system time back to CST (america/chicago) along with the php configurations. Rebooted.

In the GUI I set the user preferences to UTC. That fixed everything, until I logged out. When I log back in, it reverts.

Now, however, the graph and the TO/FROM fields are in sync. Just in the wrong TZ.
When I check the user profile, it still shows UTC, but the graphs are still wrong until I select a new TZ from the user’s profile settings, then immediately select UTC again.
Then it works until i log out/in again.


Yeah, I changed everything back to UTC again, the two php config files and the system TZ. When I log into the webGUI - the graph Axis are in the correct TZ, but the TO/FROM are not until I goto the user prefs, switch OUT of UTC and then back into UTC. Then the graph times match until I log out. Happens for every user.

it seems the user preference “defaults” to the old timezone CST until I goto the user configuration preference window and toggle the timezone field to UTC for that session.

I even checked the database and found the prefs are set for UTC for all users. It just doesn’t honor that when I first log into the GUI… BUG?

If you put “america/chicago”, I understand it would fail.

You must respect the capital letters.

You can use “Etc/UTC+TZ”, for example “Etc/UTC-3” for “America/Montevideo”.


Why are you telling me all this about CST timezones. Im trying to go from CST to UTC.

I think our confusion comes from this not really being about TZs after all.

I pasted my configs. Currently everything is set to UTC.
Both configs, system time, and user gui prefs.
The problem is getting the graph TO/FROM fields to show UTC. The to/from fields are always starting off in CST when the user logs in while the graph axis honors the php configs (utc). until the user toggles the user prefs timezone to UTC. Then the fields match the graph axis. But that gets lost once the user logs out.

Maybe i need a new topic since this seems like a bug. The graph to/from field is not honoring the users timezone preference on login

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.