I'd like to display a timestamp (HH:mm:ss) in a log file that's written using Log4Net. I want this value to be in Central Time, but I don't want the offset to appear. Ideally, I'd like it to read <HH:mm:ss> CT
. Right now, my config is set up like this: %date{HH:mm:sszzz}
, which is producing this <HH:mm:ss>-05:00
. What would be the proper format specifier to produce this timestamp format?
相关问题
- 最新的log4net是不是不支持写入到mysql了。
- log4net configuration in .net standard 1.3 project
- convert string to DateTime in C# with EDT at the e
- Jackson to deserialize Joda LocalDate from ISO Dat
- SQL - Convert Time Series Events into On/Off Pairs
相关文章
- 最新的log4net是不是不支持写入到mysql了。
- How should I configure log4net to write to %LOCALA
- Log4Net Multiple Projects
- How to truncate seconds in TSQL?
- How to remove seconds from datetime?
- OLS with pandas: datetime index as predictor
- Calculate number of working days in a month [dupli
- How can I convert a OLE Automation Date value to a
As stuartd said you cannot format DateTime with Time Zones natively. What you can do however is to create a custom
PatternLayoutConverter
that would use whichever rendering you need in theConvert
method. For reference here is the Convert method for theDatePatternConverter
:The
m_dateFormatter
field is initialized by options you can pass it by implementing theIOptionHandler
interface.Once you have your converter, add it to your layout by declaring it inside the layout tag