6.0.0-alpha14
6/25/25

[#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 06/26/2009 (5843 days ago)
Due
Updated 01/29/2010 (5626 days ago)
Assigned 06/28/2009 (5841 days ago)
Resolved 01/29/2010 (5626 days ago)
Github Issue Link
Github Pull Request
Milestone 3
Patch No

History
01/29/2010 11:43:34 PM 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.
06/28/2009 04:21:55 PM Chuck Hagenbuch Assigned to Jan Schneider
State ⇒ Assigned
 
06/26/2009 06:47:41 PM rmcauley (at) ca (dot) afilias (dot) info Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Horde Alarms and Kronolith Alerts Use Different Timezones for SQL Queries
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
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