How to fetch client time zone &convert DateTime stored in DB
How to capture Client Time Zone and use this to convert the Date and time stored in Data Base tables(in UTC) to client time zone accordingly.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjeeb LenkaPosted Jun 27, 2013, 3:25 AM
http://stackoverflow.com/questions/9869051/how-to-convert-datetime-in-specific-timezone
http://stackoverflow.com/questions/3672941/formatting-dates-and-datetimes-for-users-timezone-including-timezone-offset-in
Santhosh Kumar JayaramanPosted Jun 27, 2013, 2:57 AM
var utcNow = DateTime.UtcNow;
SaveToDB(utcNow);
to retrieve:
var utcFromDb = RetrieveTimeFromDb();
var localTime = DateTime.ToLocalTime(utcFromDb);