[horde] kronolith: adjusting for user vs. system time zone

Mark Bennett bennettm+horde at mailsnare.net
Sat Jan 8 14:42:56 PST 2005


Hi folks,

Unless I?m missing something (which is entirely possible), it appears that the
kronolith alarms assume that the user?s time zone preference is the same as
the system clock. For example, we run all of our systems in UTC but most users
will set their preference to their local time zone. As a result, events that
should be generating reminders do not because kronolith is comparing everything
against the system time.

One solution that we?ve been experimenting with is a patch to
lib/Kronolith.php that converst the system time to the user?s local time
before calling the $kronolith->listAlarms. That allows an apple-to-apple
comparison when looking for events that need to trigger a reminder.

The kronolith storage drivers (at least the sql one) is pulling in possible
events from the current day to the current date + 1. Depending on the user?s
time zone, the system date could be a day ahead or a day behind the user, so
you really need to look at day-1 to day+1.

I?ve roughed-in some code changes in our test environment to test this
approach and it seems to work well enough but wanted to get some feedback
before I offered up a patch. I?m sure there might be a more elegant approach
or maybe some other code dependency.

Cheers,
Mark




More information about the horde mailing list