开发者

What is the best way to show LocalTime for a DateTime set to UTC?

开发者 https://www.devze.com 2023-03-26 00:55 出处:网络
I\'m currently using ASP.NET MVC3 and MongoDB for a web app.MongoDB uses UTC and the server hosting the app is also using UTC. If I use DateTime.ToLocalTime() in the View that will just return the ser

I'm currently using ASP.NET MVC3 and MongoDB for a web app. MongoDB uses UTC and the server hosting the app is also using UTC. If I use DateTime.ToLocalTime() in the View that will just return the server's time which is still in UTC.

I would like to display the DateTime objects that a user interacts w开发者_如何学Pythonith in their Local time, does anyone know the best method for achieving this?

Thanks in advance.


I guess at this answer on google groups you should find answer on your question

0

精彩评论

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

关注公众号