6.0.0-git
2021-01-24

[#8381] Horde Alarms and Kronolith Alerts Use Different Timezones for SQL Queries
Summary Horde Alarms and Kronolith Alerts Use Different Timezones for SQL Queries
Queue Kronolith
Queue Version 2.3.1
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester rmcauley (at) ca (dot) afilias (dot) info
Created 2009-06-26 (4230 days ago)
Due
Updated 2010-01-29 (4013 days ago)
Assigned 2009-06-28 (4228 days ago)
Resolved 2010-01-29 (4013 days ago)
Milestone 3
Patch No

History
2010-01-29 23:43:34 Jan Schneider Comment #2
State ⇒ Resolved
Milestone ⇒ 3
Reply to this comment
In Horde 4, alarms are stored in UTC now, so that they can be stored 
and received timezone agnostic.
2009-06-28 16:21:55 Chuck Hagenbuch Assigned to Jan Schneider
State ⇒ Assigned
 
2009-06-26 18:47:41 rmcauley (at) ca (dot) afilias (dot) info Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Horde Alarms and Kronolith Alerts Use Different Timezones for SQL Queries
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
Reply to this comment
I've been continually hunting a bug where Kronolith event alarms do 
not have working emails sent.  My setup is:



- PostgreSQL 8.1

- PHP 5.1.6

- CentOS 5.2

- Apache 2.2

- Hardware clock and configured local timezone are UTC



The Horde default timezone is America/New_York, currently -4 UTC, and 
is the configured time zone on the account I am using to test this bug.



When Kronolith's SQL driver performs _listAlarms, on a test event with 
alarm I created, it returns the alarm using the local time zone of 
New_York.  (for example, 14:00)  Passing back up to the Horde Alarm 
_set function, the time stays the same: 14:00.  In the horde_alarms 
table in the database, the result is (again for emphasis) 14:00 when 
queried from a local psql command line.



What happens next is that the Horde frameworks' Alarm/sql.php, in the 
_list function, uses a $time->rfc3339DateTime() value to query for 
current alarms in the system local time zone, in my case, UTC.  The 
result is that the _list function is looking for alarms at 18:00, 
while the _set function stored the alarm as happening at 14:00.



To a human sitting at his desk, this is the same time once timezones 
are involved.  However, the field in the database is a timestamp 
without a timezone type, and the Horde logic and SQL queries do not 
take into account timezones.



As a result, no Kronolith email alerts are sent from my Horde install.



I'd be happy to contribute a patch if one of the Horde devs would 
provide guidance on what would be an acceptable solution.  Converting 
all alarms to use UTC time would, I think, be the fastest ideal 
solution.

Saved Queries