You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Curt Arnold <ca...@apache.org> on 2004/09/01 22:27:13 UTC

Non-default timezone formatting

I'm a developer on the log4cxx project 
(http://logging.apache.org/log4cxx) and am looking for suggestions to 
deal with one of our outstanding issues.  log4j allows the end user to 
specify that the times written to the logs be formatted in an arbitrary 
timezone, for example, the applications default time zone might be US 
Central, but the times in the logs to be written as US Eastern.  The 
current approach is to set the TZ environment variable, convert the 
time and set the TZ environment variable back.  Unfortunately, this has 
the possibility to introduce side effects to the main application and 
introduces threading issues.

I've reviewed the time routines in APR and they only seem to support 
the concept of a local time and GMT.  Do you have any suggestions on 
how to support formatting to an arbitary timezone in a somewhat 
portable manner?