-
-
Notifications
You must be signed in to change notification settings - Fork 437
Improve support for Half-Hour time zones #5648
Description
Describe the bug
We see a lot of errors like this in the apache error logs:
Invalid date.timezone value 'Etc/GMT-5.5', we selected the timezone 'UTC' for now. in .../cacti/lib/functions.php on line 1053
To Reproduce
Steps to reproduce the behavior:
Not sure how to reproduce this properly, but we seem to have some machines which come with a time zone of "Etc/GMT-5.5" to cacti. ON processing the request, we see tons of apache error logs, because php seems not to be aware that a -5.5h time offset is indeed valid.
Expected behavior
fractions in time offsets should work, because there are half-hour offsets in the world.
Additional context
I "fixed" this for us by simply adding a "round()" around the time-offset calculation in "global.php" around line 555. I just changed it to "round(abs($hours))" instead of jsut the "abs()" part, then it doesn't throw the error any more. This is not a really clean approach though, as we cut off the half hour offset, but at least there are a lot less logs cluttering the disks.
Not sure about what the correct format here, i just wanted to stab this very quick & very dirty. But i think this gives you a good enough clue where to look into.
Cheers & keep up the good work!