DateTime Formatting with Log4Net
问题 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? 回答1: As stuartd said you cannot format DateTime with Time Zones natively. What you can do however is to