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-----
Sent: 03 December 2004 15:41
Subject: Re: Log timestamp in UTC
Nicko, thanks for the response.
Post by Nicko CadellIt 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).
Post by Nicko CadellFailing that you would need to write a new layout that
output what you
Post by Nicko Cadellneeded. The pattern layout in 1.2 beta 8 is not extensible,
but in the
Post by Nicko Cadellcurrent 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