Specify time zones in Windows 8 / WinRT / XAML applications?

We used to use TimeZoneInfo.GetSystemTimeZones() to list time zones.

How do you do this on Windows 8?

+4
source share
2 answers

I just blogged on how to do this, and included the code you need as Essence .

In addition, to turn to another commentator, no, compatibility with ARM is not a problem, since marshaling is correct.

EDIT: just made it better and turned it into a general-purpose NuGet package:

https://nuget.org/packages/WinRTTimeZones

The source is here: https://github.com/onovotny/WinRTTimeZones

+5
source

In MSDN forums, will you have to minimize your own approach, perhaps through a service that provides ICANN data ?

Through PInvoke ( EnumDynamicTimeZoneInformation ) you can get a subset of them. And even with GetSystemTimeZones you are not guaranteed to get them all (although I expect more than with PInvoke).

+1
source

Source: https://habr.com/ru/post/1436895/


All Articles