How Do I Handle The Timezones For Every Chat Message
I am creating a web chat application using ASP.NET. I have got the chat system to work as messages are sent and relayed back to the clients. But there was something I noticed but n
Solution 1:
Store your data in UTC. Always. So instead of storing GETDATE()
, store GETUTCDATE()
(or SYSUTCDATETIME()
in SQL Server 2008+).
This makes it very easy to convert all times in a chat to whatever time zone the user is in. And there are plenty of facilities in ASP.NET to help you with this conversion if you don't want to do it in SQL.
Post a Comment for "How Do I Handle The Timezones For Every Chat Message"