开发者

How do I set DateTimes universally to local time in view engine?

I 开发者_StackOverflow社区am storing DateTimes in my db using UniversalTime. In my views/controllers, I was hoping to convert them to Local Time. Is there a way to do this other than calling .ToLocalTime() in my controller on each individual DateTime?


You could write a custom display template for DateTime.

@model System.DateTime

@Model.ToLocalTime()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜