我可以获得所有系统时区信息(C#或C ++)吗? [英] Can I get all system time zone info (C# or C++)?

查看:291
本文介绍了我可以获得所有系统时区信息(C#或C ++)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我尝试使用C#编写一个metro风格的应用程序,并想要检索所有系统时区。

I try to write a metro style app by using C# and wanna retrieve all system time zones.

在之前的C#版本中,我可以使用" TimeZoneInfo。 GetSystemTimeZones  () "
帮助我获得所有时区,但我无法在VS2011中使用此方法。

In previous C# version, I can use "TimeZoneInfo.GetSystemTimeZones ()" to help me get all time zones, but I cannot use this method in VS2011.

我也尝试调用Win32 api" GetTimeZoneList()"做同样的事情(C ++ WinRT组件),但它仍然没有找到(我包括Windows.h,WinBase.h和minwinbase.h)。

I also try to call Win32 api "GetTimeZoneList()" to do the same thing (C++ WinRT component), but it still not found (I included Windows.h, WinBase.h, and minwinbase.h).

所以,我的问题是:有没有办法获得所有系统时区信息,如我上面描述的那些API?

So, my question is: Is there any way to get all system time zone info like those APIs which I describe above?

(我已经在这个论坛中搜索了相关的关键词,但没有看到任何答案我。)

(I have already searched related key word in this forum, but didn't see any answer for me.)

非常感谢!

推荐答案

嗨ZuzuWu - Metro风格应用程序确实有一个TimeZoneInfo类:



http://msdn.microsoft.com/en-us/library/windows/apps/system.timezoneinfo(v = VS.110).aspx

 


这篇关于我可以获得所有系统时区信息(C#或C ++)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆