martinrusev/amon — Issue #64: timezone issues break From/To filtering on Processes and System pages (web)
Author: coltrane
Created: 2012-02-08 18:16:51+00:00
State: open

This report applies to the "From" and "To" fields on the "Processes" and "System" pages in the web interface.

1. When the page is first rendered, the server fills these fields with a formatted timestamp using the *server's* local time.

2. When the user clicks one of the "From" or "To" fields, the DateTimePicker operates in the *browser's* local time. (This is especially relevant when considering the DateTimePicker's use of the `maxDate` option).

3. When the user clicks "Update", the browser submits a url that includes the text values of "From" and "To". When the server receives these values, it parses them as UTC timestamps (but they aren't UTC, they're actually local time).

If the server and browser are both setup to use UTC as their local timezone, then the problems will go unnoticed. Otherwise, the resulting issues will vary depending on the relationship between the three timezones (browser's, server's, and UTC).

I have fixed the issue locally, by: (a) making the server render the initial values in UTC instead of local time, and (b) disabling `maxDate` on the DateTimePicker. This effectively forces everything in the web interface to use UTC. Disabling `maxDate` is necessary to allow dates that are "ahead of" the local time (this happens when the browser's local timezone is "behind" UTC).

I would be glad to contribute this patch --if you want it-- but it's probably not the ideal solution.