Ok, problem solved, I was a bit confused by the documentation for PatternLayout::setTimeZone

It reads: The TimeZoneID option is a time zone ID string in the format expected by the locale C++ standard class.

Not knowing what formats the locale C++ standard class expects, I tried the command "locale -a" to find valid values, but these
values do NOT work.


Turns out that using "Europe/Brussels" works perfectly, winter and summer :o)

log4j.appender.stdout.layout.TimeZone=Europe/Brussels

Maarten

Maarten Bosteels wrote:

Lars,

You think I did not know that we have summer time ?
That doesn't explain why the offset is 24 hours wrong (-22 instead of +2).
Summer time makes only one hour difference,
and the code in timezone.cpp to determine startdate and enddate of DST works.


Maarten

Schouw, Lars [TKY] wrote:

Your guys have summer time that is why.

Lars Schouw
Tokyo, Japan

-----Original Message-----
From: Maarten Bosteels [mailto:[EMAIL PROTECTED] Sent: 28 May 2004 01:30
To: [email protected]
Subject: timezone troubles


Hi all,

Default, the timestamps seem to be in UTC which is fine. (using ConversionPattern = %d{ISO8601} %m%n )
But when I try to change the timezone ([EMAIL PROTECTED]) the offset is one day wrong : -22 hours instead of +2 !?


My wall clock time is CEST (Central European Summer Time) which is UTC + 0200.

I looked a bit at the code (log4cxx-0.9.7) and did some experiments with other locale ID's, all without luck.

I just discovered that it has probably nothing todo with log4cxx code, the 'date' command has the same behaviour:

In a shell  (using Redhat Linux 9.0)

> export TZ=UTC && date -R
Thu, 27 May 2004 16:13:25 +0000        OK !!

> unset TZ && date -R   Thu, 27 May 2004 18:12:56 +0200        OK !!

> export [EMAIL PROTECTED] && date -R
Wed, 26 May 2004 18:21:24 -2200        24 hours wrong !?

Leaving TZ unset would work for me, but unfortunately it is always set in timezone.cpp (line 40)

   ::putenv((char *)T2A(timeZoneEnv.c_str()));

Default it is set to the empty string ("") which is different from leaving it unset.

Any ideas ?  Thanks,

Maarten


----------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender.
----------------------------------------------------------------------












Reply via email to