Convert stored UTC time to webuser's local time?

Convert stored UTC time to webuser's local time?

Post by Mark » Fri, 25 Sep 2009 08:28:33


ASP.NET 3.5, VB.NET.

In ASP.NET, I have a DateTime variable which I assign from an SQL database
UTC Date field:

dtFirstMeetingDateTime (e.g. September 30, 2009 3:44:00 PM UTC)

I need to display this on a webpage in the webuser's format and time. They
can be anywhere and in any language around the world. E.g., I need to
display the string:

"30/09/2009 4:44:00 AM (New Zealand Daylight Time)"


If anyone can help with the code needed to do this I'd appreciate it a lot.
 
 
 

Convert stored UTC time to webuser's local time?

Post by Alexey Smi » Fri, 25 Sep 2009 16:51:28


The easiest way is to show a list of available time zones (TZ) where
user can select one of them. Another approach could be to use js to
submit client time to the server where you could define client's TZ.