Bug #7631
closed
Timestamp bounds in event search work badly with timezones
Added by Pavel Kácha over 1 year ago.
Updated over 1 year ago.
Category:
Development - GUI
Description
When user timezone is Europe/Prague, search results are 1 or 2 hours off. Most probably wrongly (or not) interpreted timezone.
Files
- Status changed from New to In Progress
I think I know where is the issue here.
What seemed strange to me is that no matter in what timezone the user is, the results are always one hour off. I checked the query:
SELECT * FROM events AS "_mentatq(148_wnbqzt)_" WHERE "detecttime" >= '2023-03-07T02:59:55+00:00'::timestamptz AND "detecttime" <= '2023-03-07T03:00:00+00:00'::timestamptz ORDER BY "detecttime" DESC LIMIT 100
and that's when I realised that the issue is in this query. If the query has timestamp
instead of timestamptz
or 2023-03-07T02:59:55+01:00
instead of 2023-03-07T02:59:55+00:00
, we get the correct result. The timezone in Postgresql is set to localtime.
I don't know how to change the query yet.
The other option is to set the timezone in Postgresql to UTC, but I am not sure of the consequences.
- Assignee set to Rajmund Hruška
- Status changed from In Progress to Resolved
- Target version changed from Backlog to 2.11
- % Done changed from 0 to 100
- Status changed from Resolved to In Review
Merged into devel and deployed on mentat-alt.
- Status changed from In Review to Closed
- Status changed from Closed to In Progress
- % Done changed from 100 to 50
The issue is still present when using quicksearch for last X hours.
- Status changed from In Progress to Closed
- % Done changed from 50 to 100
Also available in: Atom
PDF