Вопрос

I want that all DateTime Objects come from Model may converted to Local of login user. All Datetime are stored in UTC format in Database. For Example If someone Create user and CreatedDate is stored in UTC.Now(2014-05-06 01:00PM); Then someone login from Pakistan and navigate to users view then the DateTime must show as 2014-05-06 06:00PM for last created user. I know how to convert but which is the best approach to do it. I want to convert all datetime coming from Database into current ..

Это было полезно?

Решение

I saved all My date formats in DateTime.UtcNow and add 1 column TimeZoneId in DB and check it whenever some results are need to be shown on view or any thing want to manipulate according to timezone of current user.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top