Friday, July 2, 2010

Get Local Time Zone

Here’s a quick post on how to get the local time zone in your Silverlight Applications. You need to use the System.TimeZoneInfo class to get this information. This simple call will give you your local time zone.

TimeZoneInfo.Local.StandardName



If you have a DateTime value you want to convert to local time, just call the ToLocalTime method on it and that should do it. You can also use the ToUniversalTime method on it to convert it to UTC time.



No comments:

Post a Comment