开发者

Need to get Time by TimeZoneId

开发者 https://www.devze.com 2023-02-10 10:20 出处:网络
I need to get time by TimeZoneId. I have googled but found TimeZoneInfo class and that h开发者_开发知识库ave particular method to get time by TimeZoneId. TimeZoneInfo class only supported in .net fram

I need to get time by TimeZoneId. I have googled but found TimeZoneInfo class and that h开发者_开发知识库ave particular method to get time by TimeZoneId. TimeZoneInfo class only supported in .net framework 3.5 but I am using .Net Framework 2.0.

Can anyone tell me how can I accomplish this in .net framework 2.0.

Thanks


The easiest solution really is to upgrade to .NET 3.5. That's what we did when we needed the functionality.

If you cannot do that, you're going to have to read the relevent data from the registry. Although its reasonably well documented you're still going to have to write code to correctly do the conversions which is no mean task. Get Reflector out and have a look at the implementation of the TimeZoneInfo class in System.Core.dll version 3.5 and you'll see what I mean.

I'm not aware of any third party libraries that work like TimeZoneInfo

0

精彩评论

暂无评论...
验证码 换一张
取 消