logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Log timestamp in UTC
Date Wed, 08 Dec 2004 13:15:24 GMT
There are a number of guidelines regarding the issues of the DateTime
type:

http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/
dndotnet/html/datetimecode.asp
http://weblogs.asp.net/bclteam/archive/2004/05/21/136918.aspx
http://weblogs.asp.net/bclteam/archive/2004/06/01/145487.aspx
http://www.gotdotnet.com/team/clr/bcl/TechArticles/techarticles/DateTime
FAQ/FAQ.aspx

The best practice appears to be to store the DateTime as UTC and convert
to local time where necessary, i.e. in display or for serialisation.
This is something we will need to look at. In the meantime I have added,
to CVS, support for outputting the UTC date from the PatternLayout.

Nicko

> -----Original Message-----
> From: Joe Joe [mailto:jocularjoe@hotmail.com] 
> Sent: 03 December 2004 15:41
> To: log4net-user@logging.apache.org
> Subject: Re: Log timestamp in UTC
> 
> Nicko, thanks for the response.
> 
> >It looks like the 'U' pattern may convert the time from local to 
> >universal time before displaying it.
> 
> The "U" pattern is long date + long time, not really 
> appropriate.  So it looks like this is impossible without 
> customising Log4Net (which I want to avoid).
> 
> >Failing that you would need to write a new layout that 
> output what you 
> >needed. The pattern layout in 1.2 beta 8 is not extensible, 
> but in the 
> >current CVS head it should be very easy to add another pattern that 
> >converts to UTC before rendering the date.
> 
> I think it would make sense to have patterns for both UTC and 
> local time.  
> But it would be better to retrieve the date as UTC, then 
> convert to local when rendering (local to UTC conversions are 
> ambiguous for 1h each year at the end of daylight savings time).
> 
> Joe
> 
> _________________________________________________________________
> Express yourself with cool new emoticons 
> http://www.msn.co.uk/specials/myemo
> 
> 

Mime
View raw message