-
Notifications
You must be signed in to change notification settings - Fork 96
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
Trends are always shown in UTC #76
Comments
Thanks, I did not notice it yet myself. Most views use I think I'll have to specify timezone manually in the query, as this will hit multiple DST transitions in a year (since it does a group by over all readings, both in summer and winter, at some point). |
It seems I can only fix this in PostgreSQL, as it's the only database backend to support timezone conversion in sessions. I see no other solutions, as I would have to iterate over every hour and localize it according to the |
Fixed & pushed to master. I will update the README as well, to advise postgresql over mysq, despite that mysql is more common. |
My fix caused another bug, which only happens on Gunicorn due to code cache, as the database connection get reused. I didn't revert the timezone back to UTC after changing it and executing the query I need. Django then fails: Only the webinterface process is affected when using postgres and opening the trends page. I will fix it by resetting timezone in db session to UTC. |
Trend data is shown in UTC while it would be nice to show it in the locale timezone or make it a setting.
Right now I'm seeing data from the low tariff starting from 22:00 (10 pm) in the interface while in practice, the low tariff starts at 23:00 (11 pm).
The text was updated successfully, but these errors were encountered: