-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for Half-Hour time zones #5648
Comments
There is a similar issue listed for the Owncloud project, they seem to have solved it by mapping the fractional Etc/GMT zones to ones that actually exist in the list, with Country/City notation instead of just the offset in hours. See: owncloud/core#14429 |
What Cacti version @bernisys ? |
Looks like it's not supported in any version of PHP. So, if it's not detected, I guess round is the only way to go. |
Fractional time offsets can cause huge webserver error-logs
Fractional time offsets can cause huge webserver error-logs
Hi Larry,
yes that's also my suspicion. I have searched a bit but did not find any useful hints, extept rounding or setting a named timezone that corresponds to the specific time offset. And our newer PHP 7.x was not supporting this either.
BTW: Our Cacti version is 1.2.17 (though this is not really relevant for this specific issue)
And yes it is way old, we are planning to upgrade, but there are a few obstacles to tackle first.
On Sunday, January 28, 2024 20:25 CET, TheWitness ***@***.***> wrote:
Looks like it's not supported in any version of PHP. So, if it's not detected, I guess round is the only way to go.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>[ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#5648 (comment)", "url": "#5648 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
|
Okay, I'm going to leave this hack in place for the moment and log something to the PHP people. |
Logged here: php/php-src#13428 |
@bernisys, this should be fixed in 1.2.26. I went to the PHP team and they told me that I should use a lookup table for these odd ball timezones, which I had already done post 1.2.17. Bad memory. |
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!
The text was updated successfully, but these errors were encountered: