You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Maarten Bosteels <ma...@dns.be> on 2004/05/27 18:29:40 UTC

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 (nl_BE.iso885915@euro) 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 TZ=nl_BE.iso885915@euro && 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