Skip to content
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

timezone issue #103

Open
mlcarson opened this issue Mar 7, 2024 · 3 comments
Open

timezone issue #103

mlcarson opened this issue Mar 7, 2024 · 3 comments

Comments

@mlcarson
Copy link

mlcarson commented Mar 7, 2024

My server is in America/Los_Angeles timezone and is running the latest version of Debian stable. My nfcapd data files are getting the time/date correct. The nfsen-ng v0.3 is using UTC for the frontend graphs. It graphs the data in the correct spot but the current time is being taken from UTC so when I choose the 1 hour option, it'll show nothing because I'm 8 hrs in the future.

I've modified the /etc/php/8.2/apache2/php.ini file so that date.time is set to 'America/Los_Angeles' and restarted the apache2 server. I've also restarted the entire OS and no difference.

BTW, PHP 8.2 is the latest offered by Debian stable so I'm using that rather than 8.3 since 8.2 seemed to still be the minimum supported.

Well, I somehow "solved" this. The graphs are now just showing in UTC time (not exactly what I wanted) but the data is also mapped to UTC so when the last hour of data is shown it's now accurate. This might have been an issue with the /etc/php/8.2/cli/php.ini file. I modified that but hadn't restarted the cli.php daemon so maybe that was it...

So I guess the next question would be -- is there a way of displaying the graphs in the server's local timezone rather than UTC?

@mbolli
Copy link
Owner

mbolli commented Mar 7, 2024

Can you try and set

'tz_offset' => (new \DateTimeZone(date_default_timezone_get()))->getOffset(new \DateTime('now', new \DateTimeZone('UTC'))),
to 0 to see what happens in the frontend?

@mlcarson
Copy link
Author

mlcarson commented Mar 7, 2024 via email

@mbolli
Copy link
Owner

mbolli commented Mar 13, 2024

@mlcarson can you try the latest master to see if it's better? We merged PR #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants