logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Programmatic configuration
Date Sun, 24 Sep 2006 23:27:12 GMT
dateTimeStr = DateTime.Now.ToString("yyyyMMdd-HHmm");

----- Original Message ----
From: Brendan Long <Brendan.Long@yellowpages.co.nz>
To: Log4NET User <log4net-user@logging.apache.org>
Cc: kong_hingc@yahoo.com
Sent: Sunday, September 24, 2006 5:46:06 PM
Subject: RE: Programmatic configuration

[snip]

// Insert current date and time to file name
DateTime currentTime = DateTime.Now;
String dateTimeStr = "" + currentTime.Year;
if (currentTime.Month < 10)
    dateTimeStr += "0";
dateTimeStr += currentTime.Month;
if (currentTime.Day < 10)
    dateTimeStr += "0";
dateTimeStr += currentTime.Day + "-";
if (currentTime.Hour < 10)
    dateTimeStr += "0";
dateTimeStr += currentTime.Hour;
if (currentTime.Minute < 10)
    dateTimeStr += "0";
dateTimeStr += currentTime.Minute;

[snip]




Mime
View raw message