[chora] Timezone wierdness in Chora 1.0

Jeroen van Wolffelaar jeroen@wolffelaar.nl
Wed, 5 Jun 2002 03:57:01 +0200


Hi all,

I'm happily running chora 1.0 (with horde 2.0) on a Linux (debian)
server, which is currently in CEST (UTC +0200) time.
My PHP version is 4.2.1, I'm running apache 1.3.24, and my CVS version
is 1.11.2. 'date' and 'date -u' work as expected.

When I commit a file at 14:00 local time (12:00 universal time), one
minute later chora will say the file is committed two hours and one
minute ago and also that the commit happened at 10:00.

That is obviously not correct in either UTC or local time.

This is located in chora-1.0/cvs.php:1.116.2.1, lines 179-180:
        $commitDate = gmdate('jS F Y, g:ia', $lg->date);
		$readableDate = CVSLib_File::readableTime($lg->date, true);

Apperently, $lg->date is reflecting the time as it is in '-0200' zone,
while it should reflect the unix time.

Furthermore, it'd be userful I.M.O. to make the date format string,
hardcoded here, a configuration file option (just like the timezone too,
sometimes one wants to have commit times displayed in a zone different
than UTC, which is now the only possibility without modifying the
source)

I do have a quick hack in place now for myself (simply adding '+2*60*60'
to readableTime, and a +4*60*60 to the gmdate to get the times in
CEST...), but that's not really a neat solution.

I'd be happy to provide any info required.

--Jeroen

-- 
Jeroen van Wolffelaar
Jeroen@wolffelaar.nl
http://jeroen.A-Eskwadraat.nl