[kronolith] Timezone problem, with patch
Kevin Ross
Kevin@FamilyRoss.net
Thu, 6 Jun 2002 13:57:38 -0700
In Kronolith options, if I leave the timezone set as "Use default", the
events don't list correctly on the Horde summary page. If I set it to
the correct timezone, everything works.
I have traced the problem to kronolith/lib/base.php, where it sets the
TZ environment variable. The problem is, when the option is "Use
default", it sets the variable equal to an empty string, rather than
leaving it unset. This causes the C function tzset() to use GMT instead
of local time (see tzset(3) for more info).
Below is my fix for this minor annoyance:
*** base.php.old Thu Jun 6 13:36:25 2002
--- base.php Thu Jun 6 13:32:52 2002
***************
*** 62,68 ****
// Set the timezone variable, if available.
$timezone = $GLOBALS['prefs']->getValue('timezone');
! if (isset($timezone)) {
putenv('TZ=' . $timezone);
}
--- 62,68 ----
// Set the timezone variable, if available.
$timezone = $GLOBALS['prefs']->getValue('timezone');
! if (!empty($timezone)) {
putenv('TZ=' . $timezone);
}
Some version info:
Horde 2.1 RC3
Kronolith 1.0 RC3
PHP 4.1.2
Thanks!
-- Kevin