EntLib 3.1 显示本地时间方法

With this simple change in place, you can now change your TextFormatter templates to support local times. For example, I created a template that shows several timezones in different formats:

Timestamp: {timestamp}
Timestamp local: {timestamp(local)}
Timestamp F: {timestamp(F)}
Timestamp local:F {timestamp(local:F)}

Once the Logging Application Block does its magic over my log message, I get a nicely formatted text message that looks like this:

Timestamp: 1/23/2006 2:24:18 AM
Timestamp local: 1/22/2006 6:24:18 PM
Timestamp F: Monday, January 23, 2006 2:24:18 AM
Timestamp local:F Sunday, January 22, 2006 6:24:18 PM

Looks pretty useful to me. Again, sorry that we couldn't make it work that way after a fresh install, but don't be afraid to crack open the source code to make these kinds of changes - after all, that's the reason we give it to you!
http://blogs.msdn.com/tomholl/archive/2006/01/22/516055.aspx

posted @ 2008-02-29 16:35 CSST SOFT STUDIO LOG 阅读(23) 评论(0)  编辑 收藏

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
 
另存  打印
最新IT新闻: