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()
精彩评论